Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[embedlite] Avoid sending messages to non-existing render frame actor
  • Loading branch information
rojkov committed Jul 8, 2014
1 parent e5a1ea6 commit ace7f38
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
12 changes: 6 additions & 6 deletions embedding/embedlite/embedthread/EmbedContentController.cpp
Expand Up @@ -50,7 +50,7 @@ void EmbedContentController::HandleDoubleTap(const CSSPoint& aPoint, int32_t aMo
NewRunnableMethod(this, &EmbedContentController::HandleDoubleTap, aPoint, aModifiers, aGuid));
return;
}
if (!GetListener()->HandleDoubleTap(nsIntPoint(aPoint.x, aPoint.y))) {
if (mRenderFrame && !GetListener()->HandleDoubleTap(nsIntPoint(aPoint.x, aPoint.y))) {
unused << mRenderFrame->SendHandleDoubleTap(nsIntPoint(aPoint.x, aPoint.y));
}
}
Expand All @@ -65,7 +65,7 @@ void EmbedContentController::HandleSingleTap(const CSSPoint& aPoint, int32_t aMo
NewRunnableMethod(this, &EmbedContentController::HandleSingleTap, aPoint, aModifiers, aGuid));
return;
}
if (!GetListener()->HandleSingleTap(nsIntPoint(aPoint.x, aPoint.y))) {
if (mRenderFrame && !GetListener()->HandleSingleTap(nsIntPoint(aPoint.x, aPoint.y))) {
unused << mRenderFrame->SendHandleSingleTap(nsIntPoint(aPoint.x, aPoint.y));
}
}
Expand All @@ -80,7 +80,7 @@ void EmbedContentController::HandleLongTap(const CSSPoint& aPoint, int32_t aModi
NewRunnableMethod(this, &EmbedContentController::HandleLongTap, aPoint, aModifiers, aGuid));
return;
}
if (!GetListener()->HandleLongTap(nsIntPoint(aPoint.x, aPoint.y))) {
if (mRenderFrame && !GetListener()->HandleLongTap(nsIntPoint(aPoint.x, aPoint.y))) {
unused << mRenderFrame->SendHandleLongTap(nsIntPoint(aPoint.x, aPoint.y));
}
}
Expand Down Expand Up @@ -112,7 +112,7 @@ void EmbedContentController::SendAsyncScrollDOMEvent(bool aIsRoot,
aScrollableSize.width, aScrollableSize.height);
gfxRect rect(aContentRect.x, aContentRect.y, aContentRect.width, aContentRect.height);
gfxSize size(aScrollableSize.width, aScrollableSize.height);
if (aIsRoot && !GetListener()->SendAsyncScrollDOMEvent(rect, size)) {
if (mRenderFrame && aIsRoot && !GetListener()->SendAsyncScrollDOMEvent(rect, size)) {
unused << mRenderFrame->SendAsyncScrollDOMEvent(rect, size);
}
}
Expand All @@ -127,7 +127,7 @@ void EmbedContentController::AcknowledgeScrollUpdate(const FrameMetrics::ViewID&
NewRunnableMethod(this, &EmbedContentController::AcknowledgeScrollUpdate, aScrollId, aScrollGeneration));
return;
}
if (!GetListener()->AcknowledgeScrollUpdate((uint32_t)aScrollId, aScrollGeneration)) {
if (mRenderFrame && !GetListener()->AcknowledgeScrollUpdate((uint32_t)aScrollId, aScrollGeneration)) {
unused << mRenderFrame->SendAcknowledgeScrollUpdate(aScrollId, aScrollGeneration);
}
}
Expand Down Expand Up @@ -173,7 +173,7 @@ EmbedLiteViewListener* const EmbedContentController::GetListener() const

void EmbedContentController::DoRequestContentRepaint(const FrameMetrics& aFrameMetrics)
{
if (!GetListener()->RequestContentRepaint()) {
if (mRenderFrame && !GetListener()->RequestContentRepaint()) {
unused << mRenderFrame->SendUpdateFrame(aFrameMetrics);
}
}
Expand Down
3 changes: 3 additions & 0 deletions embedding/embedlite/embedthread/EmbedLiteViewThreadParent.cpp
Expand Up @@ -647,6 +647,9 @@ EmbedLiteViewThreadParent::TextEvent(const char* composite, const char* preEdit)
NS_IMETHODIMP
EmbedLiteViewThreadParent::ViewAPIDestroyed()
{
if (mController) {
mController->ClearRenderFrame();
}
mViewAPIDestroyed = true;
mView = nullptr;

Expand Down

0 comments on commit ace7f38

Please sign in to comment.