Bug 1176954 part.8 ContentCacheInParent::OnEventNeedingAckReceived() should log the event message r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Sat, 11 Jul 2015 10:53:56 +0900
changeset 252421 8370d245d8aa8767b37e72685234efbc8b2c2917
parent 252420 2bc21c05668234919c25c3e85cb602ee3dfb46a1
child 252422 b20a2783f867861ae4f1c8c945b89687ff9a7718
push id62144
push usermasayuki@d-toybox.com
push dateSat, 11 Jul 2015 01:54:09 +0000
treeherdermozilla-inbound@8370d245d8aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1176954
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1176954 part.8 ContentCacheInParent::OnEventNeedingAckReceived() should log the event message r=smaug
dom/ipc/PBrowser.ipdl
dom/ipc/TabChild.cpp
dom/ipc/TabParent.cpp
dom/ipc/TabParent.h
widget/ContentCache.cpp
widget/ContentCache.h
--- a/dom/ipc/PBrowser.ipdl
+++ b/dom/ipc/PBrowser.ipdl
@@ -264,18 +264,20 @@ parent:
      */
     prio(urgent) sync EndIMEComposition(bool cancel)
                         returns (bool noCompositionEvent, nsString composition);
 
     /**
      * OnEventNeedingAckReceived() is called when a child process dispatches a
      * composition event or a selection event which is sent from the parent
      * process.
+     *
+     * message      The message value of the received event.
      */
-    prio(urgent) async OnEventNeedingAckReceived();
+    prio(urgent) async OnEventNeedingAckReceived(uint32_t message);
 
     /**
      * Tells chrome to start plugin IME.  If this results in a string getting
      * committed, the result is in aCommitted (otherwise aCommitted is empty).
      *
      * aKeyboardEvent     The event with which plugin IME is to be started
      * panelX and panelY  Location in screen coordinates of the IME input panel
      *                    (should be just under the plugin)
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -2654,27 +2654,27 @@ TabChild::RecvKeyEvent(const nsString& a
   nsContentUtils::SendKeyEvent(mPuppetWidget, aType, aKeyCode, aCharCode,
                                aModifiers, aPreventDefault, &ignored);
   return true;
 }
 
 bool
 TabChild::RecvCompositionEvent(const WidgetCompositionEvent& event)
 {
-  unused << SendOnEventNeedingAckReceived();
+  unused << SendOnEventNeedingAckReceived(event.message);
   WidgetCompositionEvent localEvent(event);
   localEvent.widget = mPuppetWidget;
   APZCCallbackHelper::DispatchWidgetEvent(localEvent);
   return true;
 }
 
 bool
 TabChild::RecvSelectionEvent(const WidgetSelectionEvent& event)
 {
-  unused << SendOnEventNeedingAckReceived();
+  unused << SendOnEventNeedingAckReceived(event.message);
   WidgetSelectionEvent localEvent(event);
   localEvent.widget = mPuppetWidget;
   APZCCallbackHelper::DispatchWidgetEvent(localEvent);
   return true;
 }
 
 a11y::PDocAccessibleChild*
 TabChild::AllocPDocAccessibleChild(PDocAccessibleChild*, const uint64_t&)
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -2081,29 +2081,29 @@ TabParent::RecvNotifyIMEPositionChange(c
     widget->GetIMEUpdatePreference();
   if (updatePreference.WantPositionChanged()) {
     IMEStateManager::NotifyIME(notification, widget, true);
   }
   return true;
 }
 
 bool
-TabParent::RecvOnEventNeedingAckReceived()
+TabParent::RecvOnEventNeedingAckReceived(const uint32_t& aMessage)
 {
   // This is called when the child process receives WidgetCompositionEvent or
   // WidgetSelectionEvent.
   nsCOMPtr<nsIWidget> widget = GetWidget();
   if (!widget) {
     return true;
   }
 
   // While calling OnEventNeedingAckReceived(), TabParent *might* be destroyed
   // since it may send notifications to IME.
   nsRefPtr<TabParent> kungFuDeathGrip(this);
-  mContentCache.OnEventNeedingAckReceived(widget);
+  mContentCache.OnEventNeedingAckReceived(widget, aMessage);
   return true;
 }
 
 bool
 TabParent::RecvRequestFocus(const bool& aCanRaise)
 {
   nsCOMPtr<nsIFocusManager> fm = nsFocusManager::GetFocusManager();
   if (!fm) {
--- a/dom/ipc/TabParent.h
+++ b/dom/ipc/TabParent.h
@@ -172,17 +172,17 @@ public:
                                          const bool& aCausedByComposition) override;
     virtual bool RecvNotifyIMESelectedCompositionRect(const ContentCache& aContentCache) override;
     virtual bool RecvNotifyIMESelection(const ContentCache& aContentCache,
                                         const bool& aCausedByComposition) override;
     virtual bool RecvUpdateContentCache(const ContentCache& aContentCache) override;
     virtual bool RecvNotifyIMEMouseButtonEvent(const widget::IMENotification& aEventMessage,
                                                bool* aConsumedByIME) override;
     virtual bool RecvNotifyIMEPositionChange(const ContentCache& aContentCache) override;
-    virtual bool RecvOnEventNeedingAckReceived() override;
+    virtual bool RecvOnEventNeedingAckReceived(const uint32_t& aMessage) override;
     virtual bool RecvEndIMEComposition(const bool& aCancel,
                                        bool* aNoCompositionEvent,
                                        nsString* aComposition) override;
     virtual bool RecvStartPluginIME(const WidgetKeyboardEvent& aKeyboardEvent,
                                     const int32_t& aPanelX,
                                     const int32_t& aPanelY,
                                     nsString* aCommitted) override;
     virtual bool RecvSetPluginFocused(const bool& aFocused) override;
--- a/widget/ContentCache.cpp
+++ b/widget/ContentCache.cpp
@@ -909,25 +909,26 @@ ContentCacheInParent::OnSelectionEvent(
      GetBoolName(aSelectionEvent.mExpandToClusterBoundary),
      GetBoolName(aSelectionEvent.mUseNativeLineBreak), mPendingEventsNeedingAck,
      GetBoolName(mIsComposing)));
 
   mPendingEventsNeedingAck++;
 }
 
 void
-ContentCacheInParent::OnEventNeedingAckReceived(nsIWidget* aWidget)
+ContentCacheInParent::OnEventNeedingAckReceived(nsIWidget* aWidget,
+                                                uint32_t aMessage)
 {
   // This is called when the child process receives WidgetCompositionEvent or
   // WidgetSelectionEvent.
 
   MOZ_LOG(sContentCacheLog, LogLevel::Info,
-    ("ContentCacheInParent: 0x%p OnEventNeedingAckReceived(aWidget=0x%p), "
-     "mPendingEventsNeedingAck=%u",
-     this, aWidget, mPendingEventsNeedingAck));
+    ("ContentCacheInParent: 0x%p OnEventNeedingAckReceived(aWidget=0x%p, "
+     "aMessage=%s), mPendingEventsNeedingAck=%u",
+     this, aWidget, GetEventMessageName(aMessage), mPendingEventsNeedingAck));
 
   MOZ_RELEASE_ASSERT(mPendingEventsNeedingAck > 0);
   if (--mPendingEventsNeedingAck) {
     return;
   }
 
   FlushPendingNotifications(aWidget);
 }
--- a/widget/ContentCache.h
+++ b/widget/ContentCache.h
@@ -317,17 +317,17 @@ public:
   /**
    * OnEventNeedingAckReceived() should be called when the child process
    * receives a sent event which needs acknowledging.
    *
    * WARNING: This may send notifications to IME.  That might cause destroying
    *          TabParent or aWidget.  Therefore, the caller must not destroy
    *          this instance during a call of this method.
    */
-  void OnEventNeedingAckReceived(nsIWidget* aWidget);
+  void OnEventNeedingAckReceived(nsIWidget* aWidget, uint32_t aMessage);
 
   /**
    * RequestToCommitComposition() requests to commit or cancel composition to
    * the widget.  If it's handled synchronously, this returns the number of
    * composition events after that.
    *
    * @param aWidget     The widget to be requested to commit or cancel
    *                    the composition.