Bug 1453795 - Widget - Initialize member fields in classes/ structures. r=jimm
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Fri, 15 Jun 2018 17:48:51 +0300
changeset 479909 a4f65ee3cba7d71084e92113ce1a3e2ffe428842
parent 479908 3b66a441d832b077dde52a5a2692d1b07fde3f0e
child 479910 d519616a1d4c533300be8787253de57435678b81
push id1757
push userffxbld-merge
push dateFri, 24 Aug 2018 17:02:43 +0000
treeherdermozilla-release@736023aebdb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs1453795
milestone62.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 1453795 - Widget - Initialize member fields in classes/ structures. r=jimm
widget/IMEData.h
widget/InputData.cpp
widget/MiscEvents.h
widget/MouseEvents.h
widget/PuppetBidiKeyboard.cpp
widget/PuppetWidget.cpp
widget/TextEvents.h
widget/nsBaseAppShell.cpp
widget/nsPrintSettingsImpl.cpp
--- a/widget/IMEData.h
+++ b/widget/IMEData.h
@@ -232,21 +232,25 @@ struct NativeIMEContext final
   // Pointer to native IME context.  Typically this is the result of
   // nsIWidget::GetNativeData(NS_RAW_NATIVE_IME_CONTEXT) in the parent process.
   // See also NS_ONLY_ONE_NATIVE_IME_CONTEXT.
   uintptr_t mRawNativeIMEContext;
   // Process ID of the origin of mNativeIMEContext.
   uint64_t mOriginProcessID;
 
   NativeIMEContext()
+    : mRawNativeIMEContext(0)
+    , mOriginProcessID(0)
   {
     Init(nullptr);
   }
 
   explicit NativeIMEContext(nsIWidget* aWidget)
+    : mRawNativeIMEContext(0)
+    , mOriginProcessID(0)
   {
     Init(aWidget);
   }
 
   bool IsValid() const
   {
     return mRawNativeIMEContext &&
            mOriginProcessID != static_cast<uintptr_t>(-1);
@@ -518,32 +522,34 @@ enum IMEMessage : IMEMessageType
 
 // FYI: Implemented in nsBaseWidget.cpp
 const char* ToChar(IMEMessage aIMEMessage);
 
 struct IMENotification final
 {
   IMENotification()
     : mMessage(NOTIFY_IME_OF_NOTHING)
+    , mSelectionChangeData()
   {
   }
 
   IMENotification(const IMENotification& aOther)
     : mMessage(NOTIFY_IME_OF_NOTHING)
   {
     Assign(aOther);
   }
 
   ~IMENotification()
   {
     Clear();
   }
 
   MOZ_IMPLICIT IMENotification(IMEMessage aMessage)
     : mMessage(aMessage)
+    , mSelectionChangeData()
   {
     switch (aMessage) {
       case NOTIFY_IME_OF_SELECTION_CHANGE:
         mSelectionChangeData.mString = new nsString();
         mSelectionChangeData.Clear();
         break;
       case NOTIFY_IME_OF_TEXT_CHANGE:
         mTextChangeData.Clear();
--- a/widget/InputData.cpp
+++ b/widget/InputData.cpp
@@ -61,16 +61,19 @@ SingleTouchData::SingleTouchData(int32_t
   , mLocalScreenPoint(aLocalScreenPoint)
   , mRadius(aRadius)
   , mRotationAngle(aRotationAngle)
   , mForce(aForce)
 {
 }
 
 SingleTouchData::SingleTouchData()
+  : mIdentifier(0)
+  , mRotationAngle(0.0)
+  , mForce(0.0)
 {
 }
 
 already_AddRefed<Touch> SingleTouchData::ToNewDOMTouch() const
 {
   MOZ_ASSERT(NS_IsMainThread(),
              "Can only create dom::Touch instances on main thread");
   RefPtr<Touch> touch = new Touch(mIdentifier,
@@ -86,16 +89,17 @@ MultiTouchInput::MultiTouchInput(MultiTo
   : InputData(MULTITOUCH_INPUT, aTime, aTimeStamp, aModifiers)
   , mType(aType)
   , mHandledByAPZ(false)
 {
 }
 
 MultiTouchInput::MultiTouchInput()
   : InputData(MULTITOUCH_INPUT)
+  , mType(MULTITOUCH_START)
   , mHandledByAPZ(false)
 {
 }
 
 MultiTouchInput::MultiTouchInput(const MultiTouchInput& aOther)
   : InputData(MULTITOUCH_INPUT, aOther.mTime, aOther.mTimeStamp, aOther.modifiers)
   , mType(aOther.mType)
   , mHandledByAPZ(aOther.mHandledByAPZ)
@@ -486,16 +490,17 @@ MouseInput::ToWidgetMouseEvent(nsIWidget
   event.mIgnoreRootScrollFrame = true;
   event.mFocusSequenceNumber = mFocusSequenceNumber;
 
   return event;
 }
 
 PanGestureInput::PanGestureInput()
   : InputData(PANGESTURE_INPUT)
+  , mType(PANGESTURE_MAYSTART)
   , mLineOrPageDeltaX(0)
   , mLineOrPageDeltaY(0)
   , mUserDeltaMultiplierX(1.0)
   , mUserDeltaMultiplierY(1.0)
   , mHandledByAPZ(false)
   , mFollowedByMomentum(false)
   , mRequiresContentResponseIfCannotScrollHorizontallyInStartDirection(false)
   , mOverscrollBehaviorAllowsSwipe(false)
@@ -586,16 +591,17 @@ ParentLayerPoint
 PanGestureInput::UserMultipliedLocalPanDisplacement() const
 {
   return ParentLayerPoint(mLocalPanDisplacement.x * mUserDeltaMultiplierX,
                           mLocalPanDisplacement.y * mUserDeltaMultiplierY);
 }
 
 PinchGestureInput::PinchGestureInput()
   : InputData(PINCHGESTURE_INPUT)
+  , mType(PINCHGESTURE_START)
 {
 }
 
 PinchGestureInput::PinchGestureInput(PinchGestureType aType, uint32_t aTime,
                                      TimeStamp aTimeStamp,
                                      const ScreenPoint& aFocusPoint,
                                      ParentLayerCoord aCurrentSpan,
                                      ParentLayerCoord aPreviousSpan,
@@ -635,16 +641,17 @@ PinchGestureInput::TransformToLocal(cons
     return false;
   }
   mLocalFocusPoint = *point;
   return true;
 }
 
 TapGestureInput::TapGestureInput()
   : InputData(TAPGESTURE_INPUT)
+  , mType(TAPGESTURE_LONG)
 {
 }
 
 TapGestureInput::TapGestureInput(TapGestureType aType, uint32_t aTime,
                                  TimeStamp aTimeStamp,
                                  const ScreenIntPoint& aPoint,
                                  Modifiers aModifiers)
   : InputData(TAPGESTURE_INPUT, aTime, aTimeStamp, aModifiers)
@@ -671,17 +678,21 @@ TapGestureInput::TransformToLocal(const 
     return false;
   }
   mLocalPoint = *point;
   return true;
 }
 
 ScrollWheelInput::ScrollWheelInput()
   : InputData(SCROLLWHEEL_INPUT)
+  , mDeltaType(SCROLLDELTA_LINE)
+  , mScrollMode(SCROLLMODE_INSTANT)
   , mHandledByAPZ(false)
+  , mDeltaX(0.0)
+  , mDeltaY(0.0)
   , mLineOrPageDeltaX(0)
   , mLineOrPageDeltaY(0)
   , mScrollSeriesNumber(0)
   , mUserDeltaMultiplierX(1.0)
   , mUserDeltaMultiplierY(1.0)
   , mMayHaveMomentum(false)
   , mIsMomentum(false)
   , mAPZAction(APZWheelAction::Scroll)
@@ -857,15 +868,16 @@ KeyboardInput::KeyboardInput(const Widge
       break;
   }
 
   aEvent.GetShortcutKeyCandidates(mShortcutCandidates);
 }
 
 KeyboardInput::KeyboardInput()
   : InputData(KEYBOARD_INPUT)
+  , mType(KEY_DOWN)
   , mKeyCode(0)
   , mCharCode(0)
   , mHandledByAPZ(false)
 {
 }
 
 } // namespace mozilla
--- a/widget/MiscEvents.h
+++ b/widget/MiscEvents.h
@@ -182,15 +182,16 @@ public:
   {
     AssignGUIEventData(aEvent, aCopyTargets);
 
     mRetargetToFocusedDocument = aEvent.mRetargetToFocusedDocument;
   }
 
 protected:
   WidgetPluginEvent()
+    : mRetargetToFocusedDocument(false)
   {
   }
 };
 
 } // namespace mozilla
 
 #endif // mozilla_MiscEvents_h__
--- a/widget/MouseEvents.h
+++ b/widget/MouseEvents.h
@@ -493,16 +493,17 @@ private:
     , mOverflowDeltaY(0.0)
     // Including WheelEventBinding.h here leads to an include loop, so
     // we have to hardcode WheelEventBinding::DOM_DELTA_PIXEL.
     , mDeltaMode(/* WheelEventBinding::DOM_DELTA_PIXEL = */ 0)
     , mLineOrPageDeltaX(0)
     , mLineOrPageDeltaY(0)
     , mScrollType(SCROLL_DEFAULT)
     , mCustomizedByUserPrefs(false)
+    , mMayHaveMomentum(false)
     , mIsMomentum(false)
     , mIsNoLineOrPageDelta(false)
     , mViewPortIsOverscrolled(false)
     , mCanTriggerSwipe(false)
     , mAllowToOverrideSystemScrollSpeed(false)
     , mDeltaValuesHorizontalizedForDefaultHandler(false)
   {
   }
--- a/widget/PuppetBidiKeyboard.cpp
+++ b/widget/PuppetBidiKeyboard.cpp
@@ -6,17 +6,20 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "PuppetBidiKeyboard.h"
 
 using namespace mozilla::widget;
 
 NS_IMPL_ISUPPORTS(PuppetBidiKeyboard, nsIBidiKeyboard)
 
-PuppetBidiKeyboard::PuppetBidiKeyboard() : nsIBidiKeyboard()
+PuppetBidiKeyboard::PuppetBidiKeyboard()
+  : nsIBidiKeyboard()
+  , mIsLangRTL(false)
+  , mHaveBidiKeyboards(false)
 {
 }
 
 PuppetBidiKeyboard::~PuppetBidiKeyboard()
 {
 }
 
 NS_IMETHODIMP
--- a/widget/PuppetWidget.cpp
+++ b/widget/PuppetWidget.cpp
@@ -88,16 +88,19 @@ NS_IMPL_ISUPPORTS_INHERITED(PuppetWidget
 PuppetWidget::PuppetWidget(TabChild* aTabChild)
   : mTabChild(aTabChild)
   , mMemoryPressureObserver(nullptr)
   , mDPI(-1)
   , mRounding(1)
   , mDefaultScale(-1)
   , mCursorHotspotX(0)
   , mCursorHotspotY(0)
+  , mEnabled(false)
+  , mVisible(false)
+  , mNeedIMEStateInit(false)
   , mIgnoreCompositionEvents(false)
 {
   // Setting 'Unknown' means "not yet cached".
   mInputContext.mIMEState.mEnabled = IMEState::UNKNOWN;
 
   if (!gRemoteDesktopBehaviorInitialized) {
     Preferences::AddBoolVarCache(&gRemoteDesktopBehaviorEnabled, "browser.tabs.remote.desktopbehavior", false);
     gRemoteDesktopBehaviorInitialized = true;
--- a/widget/TextEvents.h
+++ b/widget/TextEvents.h
@@ -721,16 +721,17 @@ private:
 
 class WidgetCompositionEvent : public WidgetGUIEvent
 {
 private:
   friend class mozilla::dom::PBrowserParent;
   friend class mozilla::dom::PBrowserChild;
 
   WidgetCompositionEvent()
+    : mOriginalMessage(eVoidEvent)
   {
   }
 
 public:
   virtual WidgetCompositionEvent* AsCompositionEvent() override
   {
     return this;
   }
@@ -1136,16 +1137,17 @@ private:
 
   WidgetSelectionEvent()
     : mOffset(0)
     , mLength(0)
     , mReversed(false)
     , mExpandToClusterBoundary(true)
     , mSucceeded(false)
     , mUseNativeLineBreak(true)
+    , mReason(nsISelectionListener::NO_REASON)
   {
   }
 
 public:
   virtual WidgetSelectionEvent* AsSelectionEvent() override
   {
     return this;
   }
--- a/widget/nsBaseAppShell.cpp
+++ b/widget/nsBaseAppShell.cpp
@@ -28,16 +28,17 @@ nsBaseAppShell::nsBaseAppShell()
   , mNativeEventPending(false)
   , mStarvationDelay(0)
   , mSwitchTime(0)
   , mLastNativeEventTime(0)
   , mEventloopNestingState(eEventloopNone)
   , mRunning(false)
   , mExiting(false)
   , mBlockNativeEvent(false)
+  , mProcessedGeckoEvents(false)
 {
 }
 
 nsBaseAppShell::~nsBaseAppShell()
 {
 }
 
 nsresult
--- a/widget/nsPrintSettingsImpl.cpp
+++ b/widget/nsPrintSettingsImpl.cpp
@@ -31,16 +31,18 @@ nsPrintSettings::nsPrintSettings() :
   mPrintPageDelay(50),
   mPaperData(0),
   mPaperWidth(8.5),
   mPaperHeight(11.0),
   mPaperSizeUnit(kPaperSizeInches),
   mPrintReversed(false),
   mPrintInColor(true),
   mOrientation(kPortraitOrientation),
+  mResolution(0),
+  mDuplex(0),
   mNumCopies(1),
   mPrintToFile(false),
   mOutputFormat(kOutputFormatNative),
   mIsInitedFromPrinter(false),
   mIsInitedFromPrefs(false)
 {
 
   /* member initializers and constructor code */