Bug 1048241 - Fix more bad implicit constructors in widget; r=roc
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 05 Aug 2014 09:38:21 -0400
changeset 197942 5fabfe36fa480bcce91b6749c9b1bdda92f876a5
parent 197941 3d47686129ae90bde3b655f042be3d6e1be84cc2
child 197943 f89bd78b1fc71458f04aa85b05e772a5f83e30d5
push id27256
push userkwierso@gmail.com
push dateWed, 06 Aug 2014 00:06:20 +0000
treeherdermozilla-central@6cbdd4d523a7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1048241
milestone34.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 1048241 - Fix more bad implicit constructors in widget; r=roc
widget/nsIWidget.h
widget/xpwidgets/GfxInfoCollector.h
--- a/widget/nsIWidget.h
+++ b/widget/nsIWidget.h
@@ -239,17 +239,17 @@ struct nsIMEUpdatePreference {
       NOTIFY_CHANGES_CAUSED_BY_COMPOSITION
   };
 
   nsIMEUpdatePreference()
     : mWantUpdates(DEFAULT_CONDITIONS_OF_NOTIFYING_CHANGES)
   {
   }
 
-  nsIMEUpdatePreference(Notifications aWantUpdates)
+  explicit nsIMEUpdatePreference(Notifications aWantUpdates)
     : mWantUpdates(aWantUpdates | DEFAULT_CONDITIONS_OF_NOTIFYING_CHANGES)
   {
   }
 
   void DontNotifyChangesCausedByComposition()
   {
     mWantUpdates &= ~DEFAULT_CONDITIONS_OF_NOTIFYING_CHANGES;
   }
@@ -364,17 +364,17 @@ struct IMEState {
      * Web contents can specify this value by |ime-mode: inactive;|.
      */
     CLOSED
   };
   Open mOpen;
 
   IMEState() : mEnabled(ENABLED), mOpen(DONT_CHANGE_OPEN_STATE) { }
 
-  IMEState(Enabled aEnabled, Open aOpen = DONT_CHANGE_OPEN_STATE) :
+  explicit IMEState(Enabled aEnabled, Open aOpen = DONT_CHANGE_OPEN_STATE) :
     mEnabled(aEnabled), mOpen(aOpen)
   {
   }
 };
 
 struct InputContext {
   InputContext() : mNativeIMEContext(nullptr) {}
 
@@ -447,18 +447,18 @@ struct InputContextAction {
             mCause == CAUSE_MOUSE);
   }
 
   InputContextAction() :
     mCause(CAUSE_UNKNOWN), mFocusChange(FOCUS_NOT_CHANGED)
   {
   }
 
-  InputContextAction(Cause aCause,
-                     FocusChange aFocusChange = FOCUS_NOT_CHANGED) :
+  explicit InputContextAction(Cause aCause,
+                              FocusChange aFocusChange = FOCUS_NOT_CHANGED) :
     mCause(aCause), mFocusChange(aFocusChange)
   {
   }
 };
 
 /**
  * Size constraints for setting the minimum and maximum size of a widget.
  * Values are in device pixels.
@@ -505,17 +505,17 @@ enum IMEMessage MOZ_ENUM_TYPE(int8_t)
   REQUEST_TO_COMMIT_COMPOSITION,
   // Request to cancel current composition to IME
   // (some platforms may not support)
   REQUEST_TO_CANCEL_COMPOSITION
 };
 
 struct IMENotification
 {
-  IMENotification(IMEMessage aMessage)
+  MOZ_IMPLICIT IMENotification(IMEMessage aMessage)
     : mMessage(aMessage)
   {
     switch (aMessage) {
       case NOTIFY_IME_OF_SELECTION_CHANGE:
         mSelectionChangeData.mCausedByComposition = false;
         break;
       case NOTIFY_IME_OF_TEXT_CHANGE:
         mTextChangeData.mStartOffset = 0;
--- a/widget/xpwidgets/GfxInfoCollector.h
+++ b/widget/xpwidgets/GfxInfoCollector.h
@@ -24,17 +24,17 @@ class MOZ_STACK_CLASS InfoObject
 
   public:
   void DefineProperty(const char *name, int value);
   void DefineProperty(const char *name, nsAString &value);
   void DefineProperty(const char *name, const char *value);
 
   private:
   // We need to ensure that this object lives on the stack so that GC sees it properly
-  InfoObject(JSContext *aCx);
+  explicit InfoObject(JSContext *aCx);
   InfoObject(InfoObject&);
 
   JSContext *mCx;
   JS::Rooted<JSObject*> mObj;
   bool mOk;
 };
 
 /*