Bug 1453795 - DOM - Initialize member fields in classes/ structures. r=peterv
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Sat, 16 Jun 2018 17:21:46 +0300
changeset 426320 13efb4f58614a7bb20ca3149b0ca50cf92c7a13d
parent 426319 9235548deaff3dafab06626b8ebe909ee4bdca72
child 426321 58e93d58965c4f57f20625929d33e9cafb6e0777
push id105204
push userbpostelnicu@mozilla.com
push dateThu, 12 Jul 2018 15:11:31 +0000
treeherdermozilla-inbound@13efb4f58614 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs1453795
milestone63.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 - DOM - Initialize member fields in classes/ structures. r=peterv
dom/asmjscache/AsmJSCache.cpp
dom/base/DOMException.h
dom/base/EventSource.cpp
dom/base/NodeIterator.h
dom/base/TextInputProcessor.cpp
dom/base/nsContentList.h
dom/base/nsContentPermissionHelper.cpp
dom/base/nsContentPermissionHelper.h
dom/base/nsDOMWindowUtils.cpp
dom/base/nsDocument.cpp
dom/base/nsDocumentEncoder.cpp
dom/base/nsFrameLoader.h
dom/base/nsGlobalWindowOuter.cpp
dom/base/nsJSEnvironment.h
dom/base/nsPlainTextSerializer.cpp
dom/base/nsQueryContentEventResult.cpp
dom/base/nsQueryContentEventResult.h
dom/base/nsSyncLoadService.cpp
dom/base/nsXHTMLContentSerializer.cpp
dom/base/nsXHTMLContentSerializer.h
dom/bindings/BindingDeclarations.h
dom/bindings/BindingUtils.cpp
dom/bindings/ErrorResult.h
dom/bindings/FakeString.h
dom/bindings/TypedArray.h
dom/cache/SavedTypes.h
dom/commandhandler/nsCommandParams.h
dom/fetch/FetchDriver.cpp
dom/fetch/InternalRequest.cpp
dom/gamepad/GamepadHapticActuator.h
dom/grid/GridLine.cpp
dom/ipc/ContentBridgeParent.cpp
dom/ipc/ContentChild.cpp
dom/ipc/FilePickerParent.h
dom/ipc/TabChild.h
dom/ipc/TabParent.cpp
dom/messagechannel/MessagePort.cpp
dom/messagechannel/MessagePort.h
dom/payments/PaymentActionResponse.cpp
dom/performance/Performance.cpp
dom/performance/Performance.h
dom/performance/PerformanceMainThread.cpp
dom/performance/PerformanceMainThread.h
dom/performance/PerformanceWorker.cpp
dom/serviceworkers/ServiceWorkerUpdateJob.cpp
dom/storage/StorageIPC.cpp
dom/websocket/WebSocket.cpp
dom/worklet/Worklet.cpp
dom/worklet/Worklet.h
dom/xhr/XMLHttpRequestMainThread.cpp
--- a/dom/asmjscache/AsmJSCache.cpp
+++ b/dom/asmjscache/AsmJSCache.cpp
@@ -441,16 +441,17 @@ public:
   ParentRunnable(const PrincipalInfo& aPrincipalInfo,
                  OpenMode aOpenMode,
                  const WriteParams& aWriteParams)
   : mOwningEventTarget(GetCurrentThreadEventTarget()),
     mPrincipalInfo(aPrincipalInfo),
     mOpenMode(aOpenMode),
     mWriteParams(aWriteParams),
     mOperationMayProceed(true),
+    mModuleIndex(0),
     mState(eInitial),
     mResult(JS::AsmJSCache_InternalError),
     mActorDestroyed(false),
     mOpened(false)
   {
     MOZ_ASSERT(XRE_IsParentProcess());
     AssertIsOnOwningThread();
   }
--- a/dom/base/DOMException.h
+++ b/dom/base/DOMException.h
@@ -130,17 +130,16 @@ protected:
     }
   }
 
   nsCString       mMessage;
   nsresult        mResult;
   nsCString       mName;
   nsCOMPtr<nsIStackFrame> mLocation;
   nsCOMPtr<nsISupports> mData;
-  bool            mInitialized;
 
   bool mHoldingJSVal;
   JS::Heap<JS::Value> mThrownJSVal;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(Exception, MOZILLA_EXCEPTION_IID)
 
 class DOMException : public Exception
--- a/dom/base/EventSource.cpp
+++ b/dom/base/EventSource.cpp
@@ -450,16 +450,17 @@ class InitRunnable final : public Worker
 public:
   InitRunnable(WorkerPrivate* aWorkerPrivate,
                EventSourceImpl* aEventSourceImpl,
                const nsAString& aURL)
     : WorkerMainThreadRunnable(aWorkerPrivate,
                                NS_LITERAL_CSTRING("EventSource :: Init"))
     , mImpl(aEventSourceImpl)
     , mURL(aURL)
+    , mRv(NS_ERROR_NOT_INITIALIZED)
   {
     MOZ_ASSERT(aWorkerPrivate);
     aWorkerPrivate->AssertIsOnWorkerThread();
   }
 
   bool MainThreadRun() override
   {
     // Get principal from worker's owner document or from worker.
--- a/dom/base/NodeIterator.h
+++ b/dom/base/NodeIterator.h
@@ -66,17 +66,21 @@ public:
     void Detach();
 
     bool WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
 
 private:
     virtual ~NodeIterator();
 
     struct NodePointer {
-        NodePointer() : mNode(nullptr) {}
+        NodePointer()
+          : mNode(nullptr)
+          , mBeforeNode(false)
+        {
+        }
         NodePointer(nsINode *aNode, bool aBeforeNode);
 
         typedef bool (NodePointer::*MoveToMethodType)(nsINode*);
         bool MoveToNext(nsINode *aRoot);
         bool MoveToPrevious(nsINode *aRoot);
 
         bool MoveForward(nsINode *aRoot, nsINode *aNode);
         void MoveBackward(nsINode *aParent, nsINode *aNode);
--- a/dom/base/TextInputProcessor.cpp
+++ b/dom/base/TextInputProcessor.cpp
@@ -34,16 +34,17 @@ class TextInputProcessorNotification fin
   typedef IMENotification::SelectionChangeData SelectionChangeData;
   typedef IMENotification::SelectionChangeDataBase SelectionChangeDataBase;
   typedef IMENotification::TextChangeData TextChangeData;
   typedef IMENotification::TextChangeDataBase TextChangeDataBase;
 
 public:
   explicit TextInputProcessorNotification(const char* aType)
     : mType(aType)
+    , mTextChangeData()
   {
   }
 
   explicit TextInputProcessorNotification(
              const TextChangeDataBase& aTextChangeData)
     : mType("notify-text-change")
     , mTextChangeData(aTextChangeData)
   {
@@ -274,17 +275,20 @@ protected:
 private:
   nsAutoCString mType;
   union
   {
     TextChangeDataBase mTextChangeData;
     SelectionChangeDataBase mSelectionChangeData;
   };
 
-  TextInputProcessorNotification() { }
+  TextInputProcessorNotification()
+    : mTextChangeData()
+  {
+  }
 };
 
 NS_IMPL_ISUPPORTS(TextInputProcessorNotification,
                   nsITextInputProcessorNotification)
 
 /******************************************************************************
  * TextInputProcessor
  ******************************************************************************/
--- a/dom/base/nsContentList.h
+++ b/dom/base/nsContentList.h
@@ -570,31 +570,35 @@ class nsCacheableFuncStringContentList :
 public:
   virtual ~nsCacheableFuncStringContentList();
 
   bool Equals(const nsFuncStringCacheKey* aKey) {
     return mRootNode == aKey->mRootNode && mFunc == aKey->mFunc &&
       mString == aKey->mString;
   }
 
-#ifdef DEBUG
   enum ContentListType {
     eNodeList,
     eHTMLCollection
   };
+#ifdef DEBUG
   ContentListType mType;
 #endif
 
 protected:
   nsCacheableFuncStringContentList(nsINode* aRootNode,
                                    nsContentListMatchFunc aFunc,
                                    nsContentListDestroyFunc aDestroyFunc,
                                    nsFuncStringContentListDataAllocator aDataAllocator,
-                                   const nsAString& aString) :
+                                   const nsAString& aString,
+                                   mozilla::DebugOnly<ContentListType> aType) :
     nsContentList(aRootNode, aFunc, aDestroyFunc, nullptr),
+#ifdef DEBUG
+    mType(aType),
+#endif
     mString(aString)
   {
     mData = (*aDataAllocator)(aRootNode, &mString);
     MOZ_ASSERT(mData);
   }
 
   virtual void RemoveFromCaches() override {
     RemoveFromFuncStringHashtable();
@@ -609,21 +613,18 @@ class nsCachableElementsByNameNodeList
 {
 public:
   nsCachableElementsByNameNodeList(nsINode* aRootNode,
                                    nsContentListMatchFunc aFunc,
                                    nsContentListDestroyFunc aDestroyFunc,
                                    nsFuncStringContentListDataAllocator aDataAllocator,
                                    const nsAString& aString)
     : nsCacheableFuncStringContentList(aRootNode, aFunc, aDestroyFunc,
-                                       aDataAllocator, aString)
+                                       aDataAllocator, aString, eNodeList)
   {
-#ifdef DEBUG
-    mType = eNodeList;
-#endif
   }
 
   NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED
 
   virtual JSObject* WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto) override;
 
 #ifdef DEBUG
   static const ContentListType sType;
@@ -635,21 +636,18 @@ class nsCacheableFuncStringHTMLCollectio
 {
 public:
   nsCacheableFuncStringHTMLCollection(nsINode* aRootNode,
                                       nsContentListMatchFunc aFunc,
                                       nsContentListDestroyFunc aDestroyFunc,
                                       nsFuncStringContentListDataAllocator aDataAllocator,
                                       const nsAString& aString)
     : nsCacheableFuncStringContentList(aRootNode, aFunc, aDestroyFunc,
-                                       aDataAllocator, aString)
+                                       aDataAllocator, aString, eHTMLCollection)
   {
-#ifdef DEBUG
-    mType = eHTMLCollection;
-#endif
   }
 
   virtual JSObject* WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto) override;
 
 #ifdef DEBUG
   static const ContentListType sType;
 #endif
 };
--- a/dom/base/nsContentPermissionHelper.cpp
+++ b/dom/base/nsContentPermissionHelper.cpp
@@ -162,18 +162,18 @@ ContentPermissionRequestParent::ContentP
 ContentPermissionRequestParent::~ContentPermissionRequestParent()
 {
   MOZ_COUNT_DTOR(ContentPermissionRequestParent);
 }
 
 mozilla::ipc::IPCResult
 ContentPermissionRequestParent::Recvprompt()
 {
-  mProxy = new nsContentPermissionRequestProxy();
-  if (NS_FAILED(mProxy->Init(mRequests, this))) {
+  mProxy = new nsContentPermissionRequestProxy(this);
+  if (NS_FAILED(mProxy->Init(mRequests))) {
     mProxy->Cancel();
   }
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 ContentPermissionRequestParent::RecvNotifyVisibility(const bool& aIsVisible)
 {
@@ -573,30 +573,29 @@ nsContentPermissionRequestProxy::nsConte
     return;
   }
 
   if (mOnChangeCallback) {
     mOnChangeCallback->NotifyVisibility(aIsVisible);
   }
 }
 
-nsContentPermissionRequestProxy::nsContentPermissionRequestProxy()
+nsContentPermissionRequestProxy::nsContentPermissionRequestProxy(ContentPermissionRequestParent* parent)
+  : mParent(parent)
 {
+    NS_ASSERTION(mParent, "null parent");
 }
 
 nsContentPermissionRequestProxy::~nsContentPermissionRequestProxy()
 {
 }
 
 nsresult
-nsContentPermissionRequestProxy::Init(const nsTArray<PermissionRequest>& requests,
-                                      ContentPermissionRequestParent* parent)
+nsContentPermissionRequestProxy::Init(const nsTArray<PermissionRequest>& requests)
 {
-  NS_ASSERTION(parent, "null parent");
-  mParent = parent;
   mPermissionRequests = requests;
   mRequester = new nsContentPermissionRequesterProxy(mParent);
 
   nsCOMPtr<nsIContentPermissionPrompt> prompt = do_GetService(NS_CONTENT_PERMISSION_PROMPT_CONTRACTID);
   if (!prompt) {
     return NS_ERROR_FAILURE;
   }
 
--- a/dom/base/nsContentPermissionHelper.h
+++ b/dom/base/nsContentPermissionHelper.h
@@ -121,20 +121,19 @@ private:
 using mozilla::dom::ContentPermissionRequestParent;
 
 class nsContentPermissionRequestProxy : public nsIContentPermissionRequest
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSICONTENTPERMISSIONREQUEST
 
-  nsContentPermissionRequestProxy();
+  explicit nsContentPermissionRequestProxy(ContentPermissionRequestParent* parent);
 
-  nsresult Init(const nsTArray<mozilla::dom::PermissionRequest>& requests,
-                ContentPermissionRequestParent* parent);
+  nsresult Init(const nsTArray<mozilla::dom::PermissionRequest>& requests);
 
   void OnParentDestroyed();
 
   void NotifyVisibility(const bool& aIsVisible);
 
 private:
   class nsContentPermissionRequesterProxy final : public nsIContentPermissionRequester {
   public:
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -2037,18 +2037,18 @@ nsDOMWindowUtils::SendQueryContentEvent(
       queryEvent.Init(options);
       break;
   }
 
   nsEventStatus status;
   nsresult rv = targetWidget->DispatchEvent(&queryEvent, status);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  auto* result = new nsQueryContentEventResult();
-  result->SetEventResult(widget, queryEvent);
+  auto* result = new nsQueryContentEventResult(queryEvent);
+  result->SetEventResult(widget);
   NS_ADDREF(*aResult = result);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMWindowUtils::SendSelectionSetEvent(uint32_t aOffset,
                                         uint32_t aLength,
                                         uint32_t aAdditionalFlags,
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -12569,16 +12569,18 @@ ArrayContainsTable(const nsTArray<nsCStr
 }
 
 namespace {
 
 // An object to store all preferences we need for flash blocking feature.
 struct PrefStore
 {
   PrefStore()
+    : mFlashBlockEnabled(false)
+    , mPluginsHttpOnly(false)
   {
     Preferences::AddBoolVarCache(&mFlashBlockEnabled,
                                  "plugins.flashBlock.enabled");
     Preferences::AddBoolVarCache(&mPluginsHttpOnly,
                                  "plugins.http_https_only");
 
     // We only need to register string-typed preferences.
     Preferences::RegisterCallback(UpdateStringPrefs, "urlclassifier.flashAllowTable", this);
--- a/dom/base/nsDocumentEncoder.cpp
+++ b/dom/base/nsDocumentEncoder.cpp
@@ -208,16 +208,17 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTION(nsDocumentEncoder,
                          mDocument, mSelection, mRange, mNode, mSerializer,
                          mCommonParent)
 
 nsDocumentEncoder::nsDocumentEncoder()
   : mEncoding(nullptr)
+  , mIsCopying(false)
   , mCachedBuffer(nullptr)
 {
   Initialize();
   mMimeType.AssignLiteral("text/plain");
 }
 
 void nsDocumentEncoder::Initialize(bool aClearCachedSerializer)
 {
--- a/dom/base/nsFrameLoader.h
+++ b/dom/base/nsFrameLoader.h
@@ -506,18 +506,16 @@ private:
   // attribute of the frame element.
   bool mLoadingOriginalSrc : 1;
 
   bool mRemoteBrowserShown : 1;
   bool mRemoteFrame : 1;
   bool mClipSubdocument : 1;
   bool mClampScrollPosition : 1;
   bool mObservingOwnerContent : 1;
-
-  bool mFreshProcess : 1;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsFrameLoader, NS_FRAMELOADER_IID)
 
 inline nsISupports*
 ToSupports(nsFrameLoader* aFrameLoader)
 {
   return aFrameLoader;
--- a/dom/base/nsGlobalWindowOuter.cpp
+++ b/dom/base/nsGlobalWindowOuter.cpp
@@ -7603,16 +7603,17 @@ nsGlobalWindowOuter::AbstractMainThreadF
   if (GetDocGroup()) {
     return GetDocGroup()->AbstractMainThreadFor(aCategory);
   }
   return DispatcherTrait::AbstractMainThreadFor(aCategory);
 }
 
 nsGlobalWindowOuter::TemporarilyDisableDialogs::TemporarilyDisableDialogs(
   nsGlobalWindowOuter* aWindow MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)
+  : mSavedDialogsEnabled(false)
 {
   MOZ_GUARD_OBJECT_NOTIFIER_INIT;
 
   MOZ_ASSERT(aWindow);
   nsGlobalWindowOuter* topWindowOuter = aWindow->GetScriptableTopInternal();
   if (!topWindowOuter) {
     NS_ERROR("nsGlobalWindowOuter::TemporarilyDisableDialogs used without a top "
              "window?");
--- a/dom/base/nsJSEnvironment.h
+++ b/dom/base/nsJSEnvironment.h
@@ -146,19 +146,16 @@ private:
   void Destroy();
 
   JS::Heap<JSObject*> mWindowProxy;
 
   bool mIsInitialized;
   bool mGCOnDestruction;
   bool mProcessingScriptTag;
 
-  PRTime mModalStateTime;
-  uint32_t mModalStateDepth;
-
   // mGlobalObjectRef ensures that the outer window stays alive as long as the
   // context does. It is eventually collected by the cycle collector.
   nsCOMPtr<nsIScriptGlobalObject> mGlobalObjectRef;
 
   static bool DOMOperationCallback(JSContext *cx);
 };
 
 namespace mozilla {
--- a/dom/base/nsPlainTextSerializer.cpp
+++ b/dom/base/nsPlainTextSerializer.cpp
@@ -76,17 +76,20 @@ nsresult
 NS_NewPlainTextSerializer(nsIContentSerializer** aSerializer)
 {
   RefPtr<nsPlainTextSerializer> it = new nsPlainTextSerializer();
   it.forget(aSerializer);
   return NS_OK;
 }
 
 nsPlainTextSerializer::nsPlainTextSerializer()
-  : kSpace(NS_LITERAL_STRING(" ")) // Init of "constant"
+  : mFlags(0)
+  , mFloatingLines(-1)
+  , mLineBreakDue(false)
+  , kSpace(NS_LITERAL_STRING(" ")) // Init of "constant"
 {
 
   mOutputString = nullptr;
   mHeadLevel = 0;
   mAtFirstColumn = true;
   mIndent = 0;
   mCiteQuoteLevel = 0;
   mStructs = true;       // will be read from prefs later
--- a/dom/base/nsQueryContentEventResult.cpp
+++ b/dom/base/nsQueryContentEventResult.cpp
@@ -46,20 +46,28 @@ static bool IsRectRelatedPropertyAvailab
 NS_INTERFACE_MAP_BEGIN(nsQueryContentEventResult)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIQueryContentEventResult)
   NS_INTERFACE_MAP_ENTRY(nsIQueryContentEventResult)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_ADDREF(nsQueryContentEventResult)
 NS_IMPL_RELEASE(nsQueryContentEventResult)
 
-nsQueryContentEventResult::nsQueryContentEventResult()
-  : mEventMessage(eVoidEvent)
-  , mSucceeded(false)
+nsQueryContentEventResult::nsQueryContentEventResult(mozilla::WidgetQueryContentEvent &aEvent)
+  : mEventMessage(aEvent.mMessage)
+  , mOffset(aEvent.mReply.mOffset)
+  , mTentativeCaretOffset(aEvent.mReply.mTentativeCaretOffset)
+  , mString(aEvent.mReply.mString)
+  , mRect(aEvent.mReply.mRect)
+  , mRectArray(std::move(aEvent.mReply.mRectArray))
+  , mSucceeded(aEvent.mSucceeded)
+  , mReversed(aEvent.mReply.mReversed)
 {
+  // Mark as result that is longer used.
+  aEvent.mSucceeded = false;
 }
 
 nsQueryContentEventResult::~nsQueryContentEventResult()
 {
 }
 
 NS_IMETHODIMP
 nsQueryContentEventResult::GetOffset(uint32_t* aOffset)
@@ -218,30 +226,18 @@ nsQueryContentEventResult::GetCharacterR
   *aTop = mRectArray[aOffset].y;
   *aWidth = mRectArray[aOffset].Width();
   *aHeight = mRectArray[aOffset].Height();
 
   return NS_OK;
 }
 
 void
-nsQueryContentEventResult::SetEventResult(nsIWidget* aWidget,
-                                          WidgetQueryContentEvent &aEvent)
+nsQueryContentEventResult::SetEventResult(nsIWidget* aWidget)
 {
-  mEventMessage = aEvent.mMessage;
-  mSucceeded = aEvent.mSucceeded;
-  mReversed = aEvent.mReply.mReversed;
-  mRect = aEvent.mReply.mRect;
-  mOffset = aEvent.mReply.mOffset;
-  mTentativeCaretOffset = aEvent.mReply.mTentativeCaretOffset;
-  mString = aEvent.mReply.mString;
-  mRectArray = std::move(aEvent.mReply.mRectArray);
-  // Mark as result that is longer used.
-  aEvent.mSucceeded = false;
-
   if (!IsRectRelatedPropertyAvailable(mEventMessage) ||
       !aWidget || !mSucceeded) {
     return;
   }
 
   nsIWidget* topWidget = aWidget->GetTopLevelWidget();
   if (!topWidget || topWidget == aWidget) {
     return;
--- a/dom/base/nsQueryContentEventResult.h
+++ b/dom/base/nsQueryContentEventResult.h
@@ -14,22 +14,21 @@
 #include "mozilla/Attributes.h"
 #include "mozilla/EventForwards.h"
 
 class nsIWidget;
 
 class nsQueryContentEventResult final : public nsIQueryContentEventResult
 {
 public:
-  nsQueryContentEventResult();
+  explicit nsQueryContentEventResult(mozilla::WidgetQueryContentEvent& aEvent);
   NS_DECL_ISUPPORTS
   NS_DECL_NSIQUERYCONTENTEVENTRESULT
 
-  void SetEventResult(nsIWidget* aWidget,
-                      mozilla::WidgetQueryContentEvent& aEvent);
+  void SetEventResult(nsIWidget* aWidget);
 
 protected:
   ~nsQueryContentEventResult();
 
   mozilla::EventMessage mEventMessage;
 
   uint32_t mOffset;
   uint32_t mTentativeCaretOffset;
--- a/dom/base/nsSyncLoadService.cpp
+++ b/dom/base/nsSyncLoadService.cpp
@@ -34,17 +34,21 @@ using mozilla::net::ReferrerPolicy;
  */
 
 class nsSyncLoader : public nsIStreamListener,
                      public nsIChannelEventSink,
                      public nsIInterfaceRequestor,
                      public nsSupportsWeakReference
 {
 public:
-    nsSyncLoader() : mLoading(false) {}
+    nsSyncLoader()
+      : mLoading(false)
+      , mAsyncLoadStatus(NS_ERROR_NOT_INITIALIZED)
+    {
+    }
 
     NS_DECL_ISUPPORTS
 
     nsresult LoadDocument(nsIChannel* aChannel,
                           bool aChannelIsSync, bool aForceToXML,
                           ReferrerPolicy aReferrerPolicy,
                           nsIDocument** aResult);
 
--- a/dom/base/nsXHTMLContentSerializer.cpp
+++ b/dom/base/nsXHTMLContentSerializer.cpp
@@ -43,16 +43,20 @@ NS_NewXHTMLContentSerializer(nsIContentS
 {
   RefPtr<nsXHTMLContentSerializer> it = new nsXHTMLContentSerializer();
   it.forget(aSerializer);
   return NS_OK;
 }
 
 nsXHTMLContentSerializer::nsXHTMLContentSerializer()
   : mIsHTMLSerializer(false)
+  , mIsCopying(false)
+  , mDisableEntityEncoding(0)
+  , mRewriteEncodingDeclaration(false)
+  , mIsFirstChildOfOL(false)
 {
 }
 
 nsXHTMLContentSerializer::~nsXHTMLContentSerializer()
 {
   NS_ASSERTION(mOLStateStack.IsEmpty(), "Expected OL State stack to be empty");
 }
 
--- a/dom/base/nsXHTMLContentSerializer.h
+++ b/dom/base/nsXHTMLContentSerializer.h
@@ -104,17 +104,16 @@ private:
 protected:
 
   /*
    * isHTMLParser should be set to true by the HTML parser which inherits from
    * this class. It avoids to redefine methods just for few changes.
    */
   bool          mIsHTMLSerializer;
 
-  bool          mDoHeader;
   bool          mIsCopying; // Set to true only while copying
 
   /*
    * mDisableEntityEncoding is higher than 0 while the serializer is serializing
    * the content of a element whose content is considerd CDATA by the
    * serializer (such elements are 'script', 'style', 'noscript' and
    * possibly others in XHTML) This doesn't have anything to do with if the
    * element is defined as CDATA in the DTD, it simply means we'll
--- a/dom/bindings/BindingDeclarations.h
+++ b/dom/bindings/BindingDeclarations.h
@@ -477,17 +477,17 @@ public:
   T* get() const {
     MOZ_ASSERT(inited);
     MOZ_ASSERT(ptr);
     return ptr;
   }
 
 protected:
   // ptr is left uninitialized for optimization purposes.
-  T* ptr;
+  MOZ_INIT_OUTSIDE_CTOR T* ptr;
 #ifdef DEBUG
   bool inited;
 #endif
 };
 
 // Class for representing sequences in arguments.  We use a non-auto array
 // because that allows us to use sequences of sequences and the like.  This
 // needs to be fallible because web content controls the length of the array,
--- a/dom/bindings/BindingUtils.cpp
+++ b/dom/bindings/BindingUtils.cpp
@@ -169,17 +169,21 @@ ThrowNoSetterArg(JSContext* aCx, prototy
 }
 
 } // namespace dom
 
 namespace binding_danger {
 
 template<typename CleanupPolicy>
 struct TErrorResult<CleanupPolicy>::Message {
-  Message() { MOZ_COUNT_CTOR(TErrorResult::Message); }
+  Message()
+    : mErrorNumber(dom::Err_Limit)
+  {
+    MOZ_COUNT_CTOR(TErrorResult::Message);
+  }
   ~Message() { MOZ_COUNT_DTOR(TErrorResult::Message); }
 
   nsTArray<nsString> mArgs;
   dom::ErrNum mErrorNumber;
 
   bool HasCorrectNumberOfArguments()
   {
     return GetErrorArgCount(mErrorNumber) == mArgs.Length();
--- a/dom/bindings/ErrorResult.h
+++ b/dom/bindings/ErrorResult.h
@@ -517,17 +517,20 @@ private:
 
     // mDOMExceptionInfo is set by ThrowDOMException and reported (and
     // deallocated) by SetPendingDOMException.
     DOMExceptionInfo* mDOMExceptionInfo; // valid when IsDOMException()
 
     // |mJSException| has a non-trivial constructor and therefore MUST be
     // placement-new'd into existence.
     MOZ_PUSH_DISABLE_NONTRIVIAL_UNION_WARNINGS
-    Extra() {}
+    Extra()
+      : mMessage(nullptr)
+    {
+    }
     MOZ_POP_DISABLE_NONTRIVIAL_UNION_WARNINGS
   } mExtra;
 
   Message* InitMessage(Message* aMessage) {
     // The |new| here switches the active arm of |mExtra|, from the compiler's
     // point of view.  Mere assignment *won't* necessarily do the right thing!
     new (&mExtra.mMessage) Message*(aMessage);
     return mExtra.mMessage;
--- a/dom/bindings/FakeString.h
+++ b/dom/bindings/FakeString.h
@@ -106,19 +106,19 @@ operator const nsAString& () const {
   }
 
 private:
   nsAString* ToAStringPtr() {
     return reinterpret_cast<nsString*>(this);
   }
 
   // mData is left uninitialized for optimization purposes.
-  nsString::char_type* mData;
+  MOZ_INIT_OUTSIDE_CTOR nsString::char_type* mData;
   // mLength is left uninitialized for optimization purposes.
-  nsString::size_type mLength;
+  MOZ_INIT_OUTSIDE_CTOR nsString::size_type mLength;
   nsString::DataFlags mDataFlags;
   nsString::ClassFlags mClassFlags;
 
   static const size_t sInlineCapacity = 64;
   nsString::char_type mInlineStorage[sInlineCapacity];
 
   FakeString(const FakeString& other) = delete;
   void operator=(const FakeString& other) = delete;
--- a/dom/bindings/TypedArray.h
+++ b/dom/bindings/TypedArray.h
@@ -216,16 +216,17 @@ struct ArrayBufferView_base
 {
 private:
   typedef TypedArray_base<uint8_t, UnwrapArray, GetLengthAndDataAndSharedness>
           Base;
 
 public:
   ArrayBufferView_base()
     : Base()
+    , mType(js::Scalar::MaxTypedArrayViewType)
   {
   }
 
   ArrayBufferView_base(ArrayBufferView_base&& aOther)
     : Base(std::move(aOther)),
       mType(aOther.mType)
   {
     aOther.mType = js::Scalar::MaxTypedArrayViewType;
--- a/dom/cache/SavedTypes.h
+++ b/dom/cache/SavedTypes.h
@@ -17,26 +17,44 @@
 #include "nsIOutputStream.h"
 
 namespace mozilla {
 namespace dom {
 namespace cache {
 
 struct SavedRequest
 {
-  SavedRequest() : mHasBodyId(false) { mValue.body() = void_t(); }
+  SavedRequest()
+    : mHasBodyId(false)
+    , mCacheId(0)
+  {
+    mBodyId.m0 = 0;
+    mBodyId.m1 = 0;
+    mBodyId.m2 = 0;
+    memset(mBodyId.m3, 0, sizeof(mBodyId.m3));
+    mValue.body() = void_t();
+  }
   CacheRequest mValue;
   bool mHasBodyId;
   nsID mBodyId;
   CacheId mCacheId;
 };
 
 struct SavedResponse
 {
-  SavedResponse() : mHasBodyId(false) { mValue.body() = void_t(); }
+  SavedResponse()
+    : mHasBodyId(false)
+    , mCacheId(0)
+  {
+    mBodyId.m0 = 0;
+    mBodyId.m1 = 0;
+    mBodyId.m2 = 0;
+    memset(mBodyId.m3, 0, sizeof(mBodyId.m3));
+    mValue.body() = void_t();
+  }
   CacheResponse mValue;
   bool mHasBodyId;
   nsID mBodyId;
   CacheId mCacheId;
 };
 
 } // namespace cache
 } // namespace dom
--- a/dom/commandhandler/nsCommandParams.h
+++ b/dom/commandhandler/nsCommandParams.h
@@ -37,16 +37,17 @@ protected:
       nsCString* mCString;
     } mData;
 
     nsCOMPtr<nsISupports> mISupports;
 
     HashEntry(uint8_t aType, const char* aEntryName)
       : mEntryName(aEntryName)
       , mEntryType(aType)
+      , mData()
     {
       Reset(mEntryType);
     }
 
     HashEntry(const HashEntry& aRHS)
       : mEntryType(aRHS.mEntryType)
     {
       Reset(mEntryType);
--- a/dom/fetch/FetchDriver.cpp
+++ b/dom/fetch/FetchDriver.cpp
@@ -334,16 +334,17 @@ FetchDriver::FetchDriver(InternalRequest
                          bool aIsTrackingFetch)
   : mPrincipal(aPrincipal)
   , mLoadGroup(aLoadGroup)
   , mRequest(aRequest)
   , mMainThreadEventTarget(aMainThreadEventTarget)
   , mPerformanceStorage(aPerformanceStorage)
   , mNeedToObserveOnDataAvailable(false)
   , mIsTrackingFetch(aIsTrackingFetch)
+  , mOnStopRequestCalled(false)
 #ifdef DEBUG
   , mResponseAvailableCalled(false)
   , mFetchCalled(false)
 #endif
 {
   AssertIsOnMainThread();
 
   MOZ_ASSERT(aRequest);
--- a/dom/fetch/InternalRequest.cpp
+++ b/dom/fetch/InternalRequest.cpp
@@ -119,16 +119,17 @@ InternalRequest::InternalRequest(const n
                                  RequestRedirect aRequestRedirect,
                                  RequestCredentials aRequestCredentials,
                                  const nsAString& aReferrer,
                                  ReferrerPolicy aReferrerPolicy,
                                  nsContentPolicyType aContentPolicyType,
                                  const nsAString& aIntegrity)
   : mMethod(aMethod)
   , mHeaders(aHeaders)
+  , mBodyLength(InternalResponse::UNKNOWN_BODY_SIZE)
   , mContentPolicyType(aContentPolicyType)
   , mReferrer(aReferrer)
   , mReferrerPolicy(aReferrerPolicy)
   , mEnvironmentReferrerPolicy(net::RP_Unset)
   , mMode(aMode)
   , mCredentialsMode(aRequestCredentials)
   , mResponseTainting(LoadTainting::Basic)
   , mCacheMode(aCacheMode)
@@ -179,23 +180,26 @@ InternalRequest::InternalRequest(const I
   // NOTE: does not copy body stream... use the fallible Clone() for that
 }
 
 InternalRequest::InternalRequest(const IPCInternalRequest& aIPCRequest)
   : mMethod(aIPCRequest.method())
   , mURLList(aIPCRequest.urls())
   , mHeaders(new InternalHeaders(aIPCRequest.headers(),
                                  aIPCRequest.headersGuard()))
+  , mBodyLength(InternalResponse::UNKNOWN_BODY_SIZE)
   , mContentPolicyType(aIPCRequest.contentPolicyType())
   , mReferrer(aIPCRequest.referrer())
   , mReferrerPolicy(aIPCRequest.referrerPolicy())
+  , mEnvironmentReferrerPolicy(net::RP_Unset)
   , mMode(aIPCRequest.mode())
   , mCredentialsMode(aIPCRequest.credentials())
   , mCacheMode(aIPCRequest.requestCache())
   , mRedirectMode(aIPCRequest.requestRedirect())
+  , mMozErrors(false)
 {
   MOZ_ASSERT(!mURLList.IsEmpty());
 }
 
 InternalRequest::~InternalRequest()
 {
 }
 
--- a/dom/gamepad/GamepadHapticActuator.h
+++ b/dom/gamepad/GamepadHapticActuator.h
@@ -17,20 +17,16 @@ namespace dom {
 class Promise;
 
 class GamepadHapticActuator : public nsISupports,
                               public nsWrapperCache
 {
 public:
   GamepadHapticActuator(nsISupports* aParent, uint32_t aGamepadId,
                         uint32_t aIndex);
-  explicit GamepadHapticActuator(nsISupports* aParent)
-    : mParent(aParent), mType(GamepadHapticActuatorType::Vibration)
-  {
-  }
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GamepadHapticActuator)
 
   nsISupports* GetParentObject() const;
 
   virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
 
--- a/dom/grid/GridLine.cpp
+++ b/dom/grid/GridLine.cpp
@@ -21,16 +21,17 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
 NS_INTERFACE_MAP_END
 
 GridLine::GridLine(GridLines *aParent)
   : mParent(aParent)
   , mStart(0.0)
   , mBreadth(0.0)
   , mType(GridDeclaration::Implicit)
   , mNumber(0)
+  , mNegativeNumber(0)
 {
   MOZ_ASSERT(aParent, "Should never be instantiated with a null GridLines");
 }
 
 GridLine::~GridLine()
 {
 }
 
--- a/dom/ipc/ContentBridgeParent.cpp
+++ b/dom/ipc/ContentBridgeParent.cpp
@@ -18,17 +18,18 @@ using namespace mozilla::jsipc;
 namespace mozilla {
 namespace dom {
 
 NS_IMPL_ISUPPORTS(ContentBridgeParent,
                   nsIContentParent,
                   nsIObserver)
 
 ContentBridgeParent::ContentBridgeParent()
-  : mIsForJSPlugin(false)
+  : mIsForBrowser(false)
+  , mIsForJSPlugin(false)
 {}
 
 ContentBridgeParent::~ContentBridgeParent()
 {
 }
 
 void
 ContentBridgeParent::ActorDestroy(ActorDestroyReason aWhy)
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -541,16 +541,17 @@ ContentChild* ContentChild::sSingleton;
 StaticAutoPtr<ContentChild::ShutdownCanary> ContentChild::sShutdownCanary;
 
 ContentChild::ContentChild()
  : mID(uint64_t(-1))
 #if defined(XP_WIN) && defined(ACCESSIBILITY)
  , mMainChromeTid(0)
  , mMsaaID(0)
 #endif
+ , mIsForBrowser(false)
  , mIsAlive(true)
  , mShuttingDown(false)
 {
   // This process is a content process, so it's clearly running in
   // multiprocess mode!
   nsDebugImpl::SetMultiprocessMode("Child");
 
   // When ContentChild is created, the observer service does not even exist.
--- a/dom/ipc/FilePickerParent.h
+++ b/dom/ipc/FilePickerParent.h
@@ -21,16 +21,17 @@ namespace dom {
 
 class FilePickerParent : public PFilePickerParent
 {
  public:
   FilePickerParent(const nsString& aTitle,
                    const int16_t& aMode)
   : mTitle(aTitle)
   , mMode(aMode)
+  , mResult(nsIFilePicker::returnOK)
   {}
 
   virtual ~FilePickerParent();
 
   void Done(int16_t aResult);
 
   struct BlobImplOrString
   {
--- a/dom/ipc/TabChild.h
+++ b/dom/ipc/TabChild.h
@@ -826,17 +826,16 @@ private:
   nsCOMPtr<nsIURI> mLastURI;
   RenderFrameChild* mRemoteFrame;
   RefPtr<nsIContentChild> mManager;
   uint32_t mChromeFlags;
   uint32_t mMaxTouchPoints;
   layers::LayersId mLayersId;
   int64_t mBeforeUnloadListeners;
   CSSRect mUnscaledOuterRect;
-  nscolor mLastBackgroundColor;
   Maybe<bool> mLayersConnected;
   bool mDidFakeShow;
   bool mNotified;
   bool mTriedBrowserInit;
   ScreenOrientationInternal mOrientation;
 
   bool mIgnoreKeyPressEvent;
   RefPtr<APZEventState> mAPZEventState;
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -156,16 +156,18 @@ TabParent::TabParent(nsIContentParent* a
   , mMarkedDestroying(false)
   , mIsDestroyed(false)
   , mChromeFlags(aChromeFlags)
   , mDragValid(false)
   , mInitedByParent(false)
   , mTabId(aTabId)
   , mCreatingWindow(false)
   , mCursor(eCursorInvalid)
+  , mCustomCursorHotspotX(0)
+  , mCustomCursorHotspotY(0)
   , mTabSetsCursor(false)
   , mHasContentOpener(false)
 #ifdef DEBUG
   , mActiveSupressDisplayportCount(0)
 #endif
   , mLayerTreeEpoch(1)
   , mPreserveLayers(false)
   , mRenderLayers(true)
--- a/dom/messagechannel/MessagePort.cpp
+++ b/dom/messagechannel/MessagePort.cpp
@@ -191,18 +191,19 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(MessagePort)
 NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
 
 NS_IMPL_ADDREF_INHERITED(MessagePort, DOMEventTargetHelper)
 NS_IMPL_RELEASE_INHERITED(MessagePort, DOMEventTargetHelper)
 
-MessagePort::MessagePort(nsIGlobalObject* aGlobal)
+MessagePort::MessagePort(nsIGlobalObject* aGlobal, State aState)
   : DOMEventTargetHelper(aGlobal)
+  , mState(aState)
   , mMessageQueueEnabled(false)
   , mIsKeptAlive(false)
   , mHasBeenTransferredOrClosed(false)
 {
   MOZ_ASSERT(aGlobal);
 
   mIdentifier = new MessagePortIdentifier();
   mIdentifier->neutered() = true;
@@ -216,58 +217,55 @@ MessagePort::~MessagePort()
 }
 
 /* static */ already_AddRefed<MessagePort>
 MessagePort::Create(nsIGlobalObject* aGlobal, const nsID& aUUID,
                     const nsID& aDestinationUUID, ErrorResult& aRv)
 {
   MOZ_ASSERT(aGlobal);
 
-  RefPtr<MessagePort> mp = new MessagePort(aGlobal);
+  RefPtr<MessagePort> mp = new MessagePort(aGlobal, eStateUnshippedEntangled);
   mp->Initialize(aUUID, aDestinationUUID, 1 /* 0 is an invalid sequence ID */,
-                 false /* Neutered */, eStateUnshippedEntangled, aRv);
+                 false /* Neutered */, aRv);
   return mp.forget();
 }
 
 /* static */ already_AddRefed<MessagePort>
 MessagePort::Create(nsIGlobalObject* aGlobal,
                     const MessagePortIdentifier& aIdentifier,
                     ErrorResult& aRv)
 {
   MOZ_ASSERT(aGlobal);
 
-  RefPtr<MessagePort> mp = new MessagePort(aGlobal);
+  RefPtr<MessagePort> mp = new MessagePort(aGlobal, eStateEntangling);
   mp->Initialize(aIdentifier.uuid(), aIdentifier.destinationUuid(),
-                 aIdentifier.sequenceId(), aIdentifier.neutered(),
-                 eStateEntangling, aRv);
+                 aIdentifier.sequenceId(), aIdentifier.neutered(), aRv);
   return mp.forget();
 }
 
 void
 MessagePort::UnshippedEntangle(MessagePort* aEntangledPort)
 {
   MOZ_ASSERT(aEntangledPort);
   MOZ_ASSERT(!mUnshippedEntangledPort);
 
   mUnshippedEntangledPort = aEntangledPort;
 }
 
 void
 MessagePort::Initialize(const nsID& aUUID,
                         const nsID& aDestinationUUID,
                         uint32_t aSequenceID, bool mNeutered,
-                        State aState, ErrorResult& aRv)
+                        ErrorResult& aRv)
 {
   MOZ_ASSERT(mIdentifier);
   mIdentifier->uuid() = aUUID;
   mIdentifier->destinationUuid() = aDestinationUUID;
   mIdentifier->sequenceId() = aSequenceID;
 
-  mState = aState;
-
   if (mNeutered) {
     // If this port is neutered we don't want to keep it alive artificially nor
     // we want to add listeners or WorkerRefs.
     mState = eStateDisentangled;
     return;
   }
 
   if (mState == eStateEntangling) {
--- a/dom/messagechannel/MessagePort.h
+++ b/dom/messagechannel/MessagePort.h
@@ -84,21 +84,16 @@ public:
   // These methods are useful for MessagePortChild
 
   void Entangled(nsTArray<ClonedMessageData>& aMessages);
   void MessagesReceived(nsTArray<ClonedMessageData>& aMessages);
   void StopSendingDataConfirmed();
   void Closed();
 
 private:
-  explicit MessagePort(nsIGlobalObject* aGlobal);
-  ~MessagePort();
-
-  void DisconnectFromOwner() override;
-
   enum State {
     // When a port is created by a MessageChannel it is entangled with the
     // other. They both run on the same thread, same event loop and the
     // messages are added to the queues without using PBackground actors.
     // When one of the port is shipped, the state is changed to
     // StateEntangling.
     eStateUnshippedEntangled,
 
@@ -134,19 +129,23 @@ private:
     // though the actor.
     eStateDisentangled,
 
     // We are here if Close() has been called. We are disentangled but we can
     // still send pending messages.
     eStateDisentangledForClose
   };
 
+  explicit MessagePort(nsIGlobalObject* aGlobal, State aState);
+  ~MessagePort();
+
+  void DisconnectFromOwner() override;
+
   void Initialize(const nsID& aUUID, const nsID& aDestinationUUID,
-                  uint32_t aSequenceID, bool mNeutered, State aState,
-                  ErrorResult& aRv);
+                  uint32_t aSequenceID, bool mNeutered, ErrorResult& aRv);
 
   bool ConnectToPBackground();
 
   // Dispatch events from the Message Queue using a nsRunnable.
   void Dispatch();
 
   void DispatchError();
 
--- a/dom/payments/PaymentActionResponse.cpp
+++ b/dom/payments/PaymentActionResponse.cpp
@@ -148,16 +148,17 @@ PaymentActionResponse::GetType(uint32_t*
 
 /* PaymentCanMakeActionResponse */
 
 NS_IMPL_ISUPPORTS_INHERITED(PaymentCanMakeActionResponse,
                             PaymentActionResponse,
                             nsIPaymentCanMakeActionResponse)
 
 PaymentCanMakeActionResponse::PaymentCanMakeActionResponse()
+  : mResult(false)
 {
   mType = nsIPaymentActionResponse::CANMAKE_ACTION;
 }
 
 NS_IMETHODIMP
 PaymentCanMakeActionResponse::GetResult(bool* aResult)
 {
   NS_ENSURE_ARG_POINTER(aResult);
@@ -175,16 +176,17 @@ PaymentCanMakeActionResponse::Init(const
 
 /* PaymentShowActionResponse */
 
 NS_IMPL_ISUPPORTS_INHERITED(PaymentShowActionResponse,
                             PaymentActionResponse,
                             nsIPaymentShowActionResponse)
 
 PaymentShowActionResponse::PaymentShowActionResponse()
+  : mAcceptStatus(nsIPaymentActionResponse::PAYMENT_REJECTED)
 {
   mType = nsIPaymentActionResponse::SHOW_ACTION;
 }
 
 NS_IMETHODIMP
 PaymentShowActionResponse::GetAcceptStatus(uint32_t* aAcceptStatus)
 {
   NS_ENSURE_ARG_POINTER(aAcceptStatus);
@@ -286,16 +288,17 @@ PaymentShowActionResponse::Init(const ns
 
 /* PaymentAbortActionResponse */
 
 NS_IMPL_ISUPPORTS_INHERITED(PaymentAbortActionResponse,
                             PaymentActionResponse,
                             nsIPaymentAbortActionResponse)
 
 PaymentAbortActionResponse::PaymentAbortActionResponse()
+  : mAbortStatus(nsIPaymentActionResponse::ABORT_FAILED)
 {
   mType = nsIPaymentActionResponse::ABORT_ACTION;
 }
 
 NS_IMETHODIMP
 PaymentAbortActionResponse::GetAbortStatus(uint32_t* aAbortStatus)
 {
   NS_ENSURE_ARG_POINTER(aAbortStatus);
@@ -322,16 +325,17 @@ PaymentAbortActionResponse::IsSucceeded(
 
 /* PaymentCompleteActionResponse */
 
 NS_IMPL_ISUPPORTS_INHERITED(PaymentCompleteActionResponse,
                             PaymentActionResponse,
                             nsIPaymentCompleteActionResponse)
 
 PaymentCompleteActionResponse::PaymentCompleteActionResponse()
+  : mCompleteStatus(nsIPaymentActionResponse::COMPLETE_FAILED)
 {
   mType = nsIPaymentActionResponse::COMPLETE_ACTION;
 }
 
 nsresult
 PaymentCompleteActionResponse::Init(const nsAString& aRequestId,
                                     const uint32_t aCompleteStatus)
 {
--- a/dom/performance/Performance.cpp
+++ b/dom/performance/Performance.cpp
@@ -51,43 +51,46 @@ NS_IMPL_RELEASE_INHERITED(Performance, D
 Performance::CreateForMainThread(nsPIDOMWindowInner* aWindow,
                                  nsIPrincipal* aPrincipal,
                                  nsDOMNavigationTiming* aDOMTiming,
                                  nsITimedChannel* aChannel)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   RefPtr<Performance> performance =
-    new PerformanceMainThread(aWindow, aDOMTiming, aChannel);
-  performance->mSystemPrincipal = nsContentUtils::IsSystemPrincipal(aPrincipal);
+    new PerformanceMainThread(aWindow,
+                              aDOMTiming,
+                              aChannel,
+                              nsContentUtils::IsSystemPrincipal(aPrincipal));
   return performance.forget();
 }
 
 /* static */ already_AddRefed<Performance>
 Performance::CreateForWorker(WorkerPrivate* aWorkerPrivate)
 {
   MOZ_ASSERT(aWorkerPrivate);
   aWorkerPrivate->AssertIsOnWorkerThread();
 
   RefPtr<Performance> performance = new PerformanceWorker(aWorkerPrivate);
-  performance->mSystemPrincipal = aWorkerPrivate->UsesSystemPrincipal();
   return performance.forget();
 }
 
-Performance::Performance()
+Performance::Performance(bool aSystemPrincipal)
   : mResourceTimingBufferSize(kDefaultResourceTimingBufferSize)
   , mPendingNotificationObserversTask(false)
+  , mSystemPrincipal(aSystemPrincipal)
 {
   MOZ_ASSERT(!NS_IsMainThread());
 }
 
-Performance::Performance(nsPIDOMWindowInner* aWindow)
+Performance::Performance(nsPIDOMWindowInner* aWindow, bool aSystemPrincipal)
   : DOMEventTargetHelper(aWindow)
   , mResourceTimingBufferSize(kDefaultResourceTimingBufferSize)
   , mPendingNotificationObserversTask(false)
+  , mSystemPrincipal(aSystemPrincipal)
 {
   MOZ_ASSERT(NS_IsMainThread());
 }
 
 Performance::~Performance()
 {}
 
 DOMHighResTimeStamp
--- a/dom/performance/Performance.h
+++ b/dom/performance/Performance.h
@@ -113,18 +113,18 @@ public:
   void MemoryPressure();
 
   size_t SizeOfUserEntries(mozilla::MallocSizeOf aMallocSizeOf) const;
   size_t SizeOfResourceEntries(mozilla::MallocSizeOf aMallocSizeOf) const;
 
   void InsertResourceEntry(PerformanceEntry* aEntry);
 
 protected:
-  Performance();
-  explicit Performance(nsPIDOMWindowInner* aWindow);
+  explicit Performance(bool aSystemPrincipal);
+  Performance(nsPIDOMWindowInner* aWindow, bool aSystemPrincipal);
 
   virtual ~Performance();
 
   virtual void InsertUserEntry(PerformanceEntry* aEntry);
 
   void ClearUserEntries(const Optional<nsAString>& aEntryName,
                         const nsAString& aEntryType);
 
--- a/dom/performance/PerformanceMainThread.cpp
+++ b/dom/performance/PerformanceMainThread.cpp
@@ -70,18 +70,19 @@ NS_IMPL_RELEASE_INHERITED(PerformanceMai
 // QueryInterface implementation for PerformanceMainThread
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(PerformanceMainThread)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END_INHERITING(Performance)
 
 PerformanceMainThread::PerformanceMainThread(nsPIDOMWindowInner* aWindow,
                                              nsDOMNavigationTiming* aDOMTiming,
-                                             nsITimedChannel* aChannel)
-  : Performance(aWindow)
+                                             nsITimedChannel* aChannel,
+                                             bool aPrincipal)
+  : Performance(aWindow, aPrincipal)
   , mDOMTiming(aDOMTiming)
   , mChannel(aChannel)
 {
   MOZ_ASSERT(aWindow, "Parent window object should be provided");
 }
 
 PerformanceMainThread::~PerformanceMainThread()
 {
--- a/dom/performance/PerformanceMainThread.h
+++ b/dom/performance/PerformanceMainThread.h
@@ -14,17 +14,18 @@ namespace mozilla {
 namespace dom {
 
 class PerformanceMainThread final : public Performance
                                   , public PerformanceStorage
 {
 public:
   PerformanceMainThread(nsPIDOMWindowInner* aWindow,
                         nsDOMNavigationTiming* aDOMTiming,
-                        nsITimedChannel* aChannel);
+                        nsITimedChannel* aChannel,
+                        bool aPrincipal);
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(PerformanceMainThread,
                                                          Performance)
 
   PerformanceStorage* AsPerformanceStorage() override
   {
     return this;
--- a/dom/performance/PerformanceWorker.cpp
+++ b/dom/performance/PerformanceWorker.cpp
@@ -7,17 +7,18 @@
 #include "PerformanceWorker.h"
 #include "mozilla/dom/DOMPrefs.h"
 #include "mozilla/dom/WorkerPrivate.h"
 
 namespace mozilla {
 namespace dom {
 
 PerformanceWorker::PerformanceWorker(WorkerPrivate* aWorkerPrivate)
-  : mWorkerPrivate(aWorkerPrivate)
+  : Performance(aWorkerPrivate->UsesSystemPrincipal())
+  , mWorkerPrivate(aWorkerPrivate)
 {
   mWorkerPrivate->AssertIsOnWorkerThread();
 }
 
 PerformanceWorker::~PerformanceWorker()
 {
   mWorkerPrivate->AssertIsOnWorkerThread();
 }
--- a/dom/serviceworkers/ServiceWorkerUpdateJob.cpp
+++ b/dom/serviceworkers/ServiceWorkerUpdateJob.cpp
@@ -203,16 +203,17 @@ ServiceWorkerUpdateJob::ServiceWorkerUpd
     nsIPrincipal* aPrincipal,
     const nsACString& aScope,
     const nsACString& aScriptSpec,
     nsILoadGroup* aLoadGroup,
     ServiceWorkerUpdateViaCache aUpdateViaCache)
   : ServiceWorkerJob(aType, aPrincipal, aScope, aScriptSpec)
   , mLoadGroup(aLoadGroup)
   , mUpdateViaCache(aUpdateViaCache)
+  , mOnFailure(serviceWorkerScriptCache::OnFailure::DoNothing)
 {
 }
 
 ServiceWorkerUpdateJob::~ServiceWorkerUpdateJob()
 {
 }
 
 void
--- a/dom/storage/StorageIPC.cpp
+++ b/dom/storage/StorageIPC.cpp
@@ -912,16 +912,17 @@ public:
                const nsAString& aValue = EmptyString())
     : Runnable("dom::LoadRunnable")
     , mParent(aParent)
     , mType(aType)
     , mSuffix(aOriginSuffix)
     , mOrigin(aOriginNoSuffix)
     , mKey(aKey)
     , mValue(aValue)
+    , mRv(NS_ERROR_NOT_INITIALIZED)
   { }
 
   LoadRunnable(StorageDBParent* aParent,
                TaskType aType,
                const nsACString& aOriginSuffix,
                const nsACString& aOriginNoSuffix,
                nsresult aRv)
     : Runnable("dom::LoadRunnable")
--- a/dom/websocket/WebSocket.cpp
+++ b/dom/websocket/WebSocket.cpp
@@ -93,16 +93,17 @@ public:
   : mWebSocket(aWebSocket)
   , mIsServerSide(false)
   , mSecure(false)
   , mOnCloseScheduled(false)
   , mFailed(false)
   , mDisconnectingOrDisconnected(false)
   , mCloseEventWasClean(false)
   , mCloseEventCode(nsIWebSocketChannel::CLOSE_ABNORMAL)
+  , mPort(0)
   , mScriptLine(0)
   , mScriptColumn(0)
   , mInnerWindowID(0)
   , mPrivateBrowsing(false)
   , mIsMainThread(true)
   , mMutex("WebSocketImpl::mMutex")
   , mWorkerShuttingDown(false)
   {
--- a/dom/worklet/Worklet.cpp
+++ b/dom/worklet/Worklet.cpp
@@ -428,19 +428,29 @@ ExecutionRunnable::RunOnMainThread()
   }
 
   mHandler->ExecutionSucceeded();
 }
 
 // ---------------------------------------------------------------------------
 // WorkletLoadInfo
 
-WorkletLoadInfo::WorkletLoadInfo()
+WorkletLoadInfo::WorkletLoadInfo(nsPIDOMWindowInner* aWindow, nsIPrincipal* aPrincipal)
+  : mInnerWindowID(aWindow->WindowID())
+  , mDumpEnabled(DOMPrefs::DumpEnabled())
+  , mOriginAttributes(BasePrincipal::Cast(aPrincipal)->OriginAttributesRef())
+  , mPrincipal(aPrincipal)
 {
   MOZ_ASSERT(NS_IsMainThread());
+  nsPIDOMWindowOuter* outerWindow = aWindow->GetOuterWindow();
+  if (outerWindow) {
+    mOuterWindowID = outerWindow->WindowID();
+  } else {
+    mOuterWindowID = 0;
+  }
 }
 
 WorkletLoadInfo::~WorkletLoadInfo()
 {
   MOZ_ASSERT(NS_IsMainThread());
 }
 
 // ---------------------------------------------------------------------------
@@ -467,42 +477,25 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 Worklet::Worklet(nsPIDOMWindowInner* aWindow, nsIPrincipal* aPrincipal,
                  WorkletType aWorkletType)
   : mWindow(aWindow)
   , mWorkletType(aWorkletType)
+  , mWorkletLoadInfo(aWindow, aPrincipal)
 {
   MOZ_ASSERT(aWindow);
   MOZ_ASSERT(aPrincipal);
   MOZ_ASSERT(NS_IsMainThread());
 
 #ifdef RELEASE_OR_BETA
   MOZ_CRASH("This code should not go to release/beta yet!");
 #endif
-
-  // Reset mWorkletLoadInfo and populate it.
-
-  memset(&mWorkletLoadInfo, 0, sizeof(WorkletLoadInfo));
-
-  mWorkletLoadInfo.mInnerWindowID = aWindow->WindowID();
-
-  nsPIDOMWindowOuter* outerWindow = aWindow->GetOuterWindow();
-  if (outerWindow) {
-    mWorkletLoadInfo.mOuterWindowID = outerWindow->WindowID();
-  }
-
-  mWorkletLoadInfo.mOriginAttributes =
-    BasePrincipal::Cast(aPrincipal)->OriginAttributesRef();
-
-  mWorkletLoadInfo.mPrincipal = aPrincipal;
-
-  mWorkletLoadInfo.mDumpEnabled = DOMPrefs::DumpEnabled();
 }
 
 Worklet::~Worklet()
 {
   TerminateThread();
 }
 
 JSObject*
--- a/dom/worklet/Worklet.h
+++ b/dom/worklet/Worklet.h
@@ -25,17 +25,17 @@ class Worklet;
 class WorkletFetchHandler;
 class WorkletGlobalScope;
 class WorkletThread;
 enum class CallerType : uint32_t;
 
 class WorkletLoadInfo
 {
 public:
-  WorkletLoadInfo();
+  WorkletLoadInfo(nsPIDOMWindowInner* aWindow, nsIPrincipal* aPrincipal);
   ~WorkletLoadInfo();
 
   uint64_t OuterWindowID() const { return mOuterWindowID; }
   uint64_t InnerWindowID() const { return mInnerWindowID; }
   bool DumpEnabled() const { return mDumpEnabled; }
 
   const OriginAttributes& OriginAttributesRef() const
   {
--- a/dom/xhr/XMLHttpRequestMainThread.cpp
+++ b/dom/xhr/XMLHttpRequestMainThread.cpp
@@ -205,16 +205,17 @@ XMLHttpRequestMainThread::XMLHttpRequest
     mProgressSinceLastProgressEvent(false),
     mRequestSentTime(0), mTimeoutMilliseconds(0),
     mErrorLoad(ErrorType::eOK), mErrorParsingXML(false),
     mWaitingForOnStopRequest(false),
     mProgressTimerIsActive(false),
     mIsHtml(false),
     mWarnAboutSyncHtml(false),
     mLoadTotal(-1),
+    mLoadTransferred(0),
     mIsSystem(false),
     mIsAnon(false),
     mFirstStartRequestSeen(false),
     mInLoadProgressEvent(false),
     mResultJSON(JS::UndefinedValue()),
     mResultArrayBuffer(nullptr),
     mIsMappedArrayBuffer(false),
     mXPCOMifier(nullptr),