Bug 1368554 ContentCacheInParent::mPendingCompositionCount should be decreased when TextCompositin which has dispatched composition events to corresponding remote process r=m_kato

ContentCacheInParent::mPendingCompositionCount is now managed with composition events which TabParent received. However, TextComposition doesn't dispatch composition events after coming request to commit active composition.  Therefore, composition is committed forcibly in a remote process over 255 times, the main process crashes.

It's the safest way to use TextComposition to manage ContentCacheInParent::mPendingCompositionCount.

MozReview-Commit-ID: DEhzYcK1zcW
This commit is contained in:
Masayuki Nakano
2017-06-10 02:42:16 +09:00
parent 7aa65eaa25
commit bf2e198c3d
7 changed files with 60 additions and 15 deletions

View File

@@ -1162,13 +1162,8 @@ ContentCacheInParent::OnEventNeedingAckHandled(nsIWidget* aWidget,
MOZ_LOG(sContentCacheLog, LogLevel::Info,
("0x%p OnEventNeedingAckHandled(aWidget=0x%p, "
"aMessage=%s), mPendingEventsNeedingAck=%u, mPendingCompositionCount=%" PRIu8,
this, aWidget, ToChar(aMessage), mPendingEventsNeedingAck, mPendingCompositionCount));
if (WidgetCompositionEvent::IsFollowedByCompositionEnd(aMessage)) {
MOZ_RELEASE_ASSERT(mPendingCompositionCount > 0);
mPendingCompositionCount--;
}
"aMessage=%s), mPendingEventsNeedingAck=%u",
this, aWidget, ToChar(aMessage), mPendingEventsNeedingAck));
MOZ_RELEASE_ASSERT(mPendingEventsNeedingAck > 0);
if (--mPendingEventsNeedingAck) {
@@ -1178,6 +1173,17 @@ ContentCacheInParent::OnEventNeedingAckHandled(nsIWidget* aWidget,
FlushPendingNotifications(aWidget);
}
void
ContentCacheInParent::OnDestroyTextComposition()
{
MOZ_LOG(sContentCacheLog, LogLevel::Info,
("0x%p OnDestroyTextComposition(), "
"mPendingEventsNeedingAck=%u, mPendingCompositionCount=%" PRIu8,
this, mPendingEventsNeedingAck, mPendingCompositionCount));
MOZ_RELEASE_ASSERT(mPendingCompositionCount > 0);
mPendingCompositionCount--;
}
bool
ContentCacheInParent::RequestIMEToCommitComposition(nsIWidget* aWidget,
bool aCancel,