Bug 1325234 (part 1) - Streamline nsIWidget::NotifyIME. r=jimm.
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 20 Dec 2016 09:55:30 +1100
changeset 373490 c9fc4ad67f3ddcd876962cb9fa8f4f950b5abeec
parent 373489 f99d55d2dc137b3b8f63192d2d65c20bf7c83bd9
child 373491 8da1583fcd48bc11ff425300a31ed220b96fb415
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs1325234
milestone53.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 1325234 (part 1) - Streamline nsIWidget::NotifyIME. r=jimm. This patch changes it from |NS_IMETHOD| to |virtual nsresult|. The callsites were a mix of checked and unchecked so using |MOZ_MUST_USE| didn't feel appropriate.
widget/cocoa/TextInputHandler.mm
widget/nsBaseWidget.cpp
widget/nsBaseWidget.h
widget/nsIWidget.h
widget/uikit/nsWindow.h
--- a/widget/cocoa/TextInputHandler.mm
+++ b/widget/cocoa/TextInputHandler.mm
@@ -2512,17 +2512,17 @@ IMEInputHandler::GetCurrentTSMDocumentID
  *    run after the stack is finished, e.g, some methods cannot run the jobs
  *    during processing the focus event.  And also some other jobs should be
  *    run at the next focus event is processed.
  *    The pending methods are recorded in mPendingMethods.  They are executed
  *    by ExecutePendingMethods via FlushPendingMethods.
  *
  ******************************************************************************/
 
-NS_IMETHODIMP
+nsresult
 IMEInputHandler::NotifyIME(TextEventDispatcher* aTextEventDispatcher,
                            const IMENotification& aNotification)
 {
   switch (aNotification.mMessage) {
     case REQUEST_TO_COMMIT_COMPOSITION:
       CommitIMEComposition();
       return NS_OK;
     case REQUEST_TO_CANCEL_COMPOSITION:
--- a/widget/nsBaseWidget.cpp
+++ b/widget/nsBaseWidget.cpp
@@ -1753,17 +1753,17 @@ nsBaseWidget::NotifyUIStateChanged(UISta
   if (nsIDocument* doc = GetDocument()) {
     nsPIDOMWindowOuter* win = doc->GetWindow();
     if (win) {
       win->SetKeyboardIndicators(aShowAccelerators, aShowFocusRings);
     }
   }
 }
 
-NS_IMETHODIMP
+nsresult
 nsBaseWidget::NotifyIME(const IMENotification& aIMENotification)
 {
   switch (aIMENotification.mMessage) {
     case REQUEST_TO_COMMIT_COMPOSITION:
     case REQUEST_TO_CANCEL_COMPOSITION:
       // Currently, if native IME handler doesn't use TextEventDispatcher,
       // the request may be notified to mTextEventDispatcher or native IME
       // directly.  Therefore, if mTextEventDispatcher has a composition,
--- a/widget/nsBaseWidget.h
+++ b/widget/nsBaseWidget.h
@@ -258,17 +258,18 @@ public:
                                           int32_t aHorizontal,
                                           int32_t aVertical) override
                           { return NS_ERROR_NOT_IMPLEMENTED; }
   virtual MOZ_MUST_USE nsresult
                           BeginMoveDrag(mozilla::WidgetMouseEvent* aEvent) override
                           { return NS_ERROR_NOT_IMPLEMENTED; }
   virtual nsresult        ActivateNativeMenuItemAt(const nsAString& indexString) override { return NS_ERROR_NOT_IMPLEMENTED; }
   virtual nsresult        ForceUpdateNativeMenuAt(const nsAString& indexString) override { return NS_ERROR_NOT_IMPLEMENTED; }
-  NS_IMETHOD              NotifyIME(const IMENotification& aIMENotification) override final;
+  virtual nsresult        NotifyIME(const IMENotification& aIMENotification)
+                            override final;
   virtual MOZ_MUST_USE nsresult
                           StartPluginIME(const mozilla::WidgetKeyboardEvent& aKeyboardEvent,
                                          int32_t aPanelX, int32_t aPanelY,
                                          nsString& aCommitted) override
                           { return NS_ERROR_NOT_IMPLEMENTED; }
   virtual void            SetPluginFocused(bool& aFocused) override {}
   virtual void            SetCandidateWindowForPlugin(
                             const mozilla::widget::CandidateWindowPosition&
--- a/widget/nsIWidget.h
+++ b/widget/nsIWidget.h
@@ -1733,17 +1733,17 @@ public:
     }
 
     /**
      * Notify IME of the specified notification.
      *
      * @return If the notification is mouse button event and it's consumed by
      *         IME, this returns NS_SUCCESS_EVENT_CONSUMED.
      */
-    NS_IMETHOD NotifyIME(const IMENotification& aIMENotification) = 0;
+    virtual nsresult NotifyIME(const IMENotification& aIMENotification) = 0;
 
     /**
      * 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/widget/uikit/nsWindow.h
+++ b/widget/uikit/nsWindow.h
@@ -79,17 +79,18 @@ public:
     NS_IMETHOD DispatchEvent(mozilla::WidgetGUIEvent* aEvent,
                              nsEventStatus& aStatus) override;
 
     void WillPaintWindow();
     bool PaintWindow(LayoutDeviceIntRegion aRegion);
 
     bool HasModalDescendents() { return false; }
 
-    //NS_IMETHOD NotifyIME(const IMENotification& aIMENotification) override;
+    //virtual nsresult
+    //NotifyIME(const IMENotification& aIMENotification) override;
     NS_IMETHOD_(void) SetInputContext(
                         const InputContext& aContext,
                         const InputContextAction& aAction);
     NS_IMETHOD_(InputContext) GetInputContext();
     /*
     NS_IMETHOD_(bool) ExecuteNativeKeyBinding(
                         NativeKeyBindingsType aType,
                         const mozilla::WidgetKeyboardEvent& aEvent,