Bug 1231132 - setting mStatus in constructors to NS_OK in order to silence a Coverity checker. It's not a bug since this gets set by ScheduleLoadEventIfNeeded, and is only used after that has been called. r?dbaron draft
authorBogdan Postelnicu <bogdan.postelnicu@softvision.ro>
Wed, 10 Feb 2016 12:22:58 +0200
changeset 330012 ba03d1f9f6f5a43fd080687d09bf4bd1ff0fa11b
parent 329801 2dfb45d74f42d2a0010696f5fd47c7a7da94cedb
child 514090 53e0a4dd5d3c4c4df3adb2eed1570053e87a8ccb
push id10667
push userBogdan.Postelnicu@softvision.ro
push dateWed, 10 Feb 2016 10:24:48 +0000
reviewersdbaron
bugs1231132
milestone47.0a1
Bug 1231132 - setting mStatus in constructors to NS_OK in order to silence a Coverity checker. It's not a bug since this gets set by ScheduleLoadEventIfNeeded, and is only used after that has been called. r?dbaron MozReview-Commit-ID: CEKFr3xerIg
layout/style/Loader.cpp
--- a/layout/style/Loader.cpp
+++ b/layout/style/Loader.cpp
@@ -325,17 +325,18 @@ SheetLoadData::SheetLoadData(Loader* aLo
     mMustNotify(false),
     mWasAlternate(aIsAlternate),
     mParsingMode(eAuthorSheetFeatures),
     mUseSystemPrincipal(false),
     mSheetAlreadyComplete(false),
     mOwningElement(aOwningElement),
     mObserver(aObserver),
     mLoaderPrincipal(aLoaderPrincipal),
-    mRequestingNode(aRequestingNode)
+    mRequestingNode(aRequestingNode),
+    mStatus(NS_OK)
 {
   NS_PRECONDITION(mLoader, "Must have a loader!");
 }
 
 SheetLoadData::SheetLoadData(Loader* aLoader,
                              nsIURI* aURI,
                              CSSStyleSheet* aSheet,
                              SheetLoadData* aParentData,
@@ -356,17 +357,18 @@ SheetLoadData::SheetLoadData(Loader* aLo
     mMustNotify(false),
     mWasAlternate(false),
     mParsingMode(eAuthorSheetFeatures),
     mUseSystemPrincipal(false),
     mSheetAlreadyComplete(false),
     mOwningElement(nullptr),
     mObserver(aObserver),
     mLoaderPrincipal(aLoaderPrincipal),
-    mRequestingNode(aRequestingNode)
+    mRequestingNode(aRequestingNode),
+    mStatus(NS_OK)
 {
   NS_PRECONDITION(mLoader, "Must have a loader!");
   if (mParentData) {
     mSyncLoad = mParentData->mSyncLoad;
     mIsNonDocumentSheet = mParentData->mIsNonDocumentSheet;
     mParsingMode = mParentData->mParsingMode;
     mUseSystemPrincipal = mParentData->mUseSystemPrincipal;
     ++(mParentData->mPendingChildren);
@@ -400,17 +402,18 @@ SheetLoadData::SheetLoadData(Loader* aLo
     mWasAlternate(false),
     mParsingMode(aParsingMode),
     mUseSystemPrincipal(aUseSystemPrincipal),
     mSheetAlreadyComplete(false),
     mOwningElement(nullptr),
     mObserver(aObserver),
     mLoaderPrincipal(aLoaderPrincipal),
     mRequestingNode(aRequestingNode),
-    mCharsetHint(aCharset)
+    mCharsetHint(aCharset),
+    mStatus(NS_OK)
 {
   NS_PRECONDITION(mLoader, "Must have a loader!");
   NS_PRECONDITION(aParsingMode == eAuthorSheetFeatures ||
                   aParsingMode == eUserSheetFeatures ||
                   aParsingMode == eAgentSheetFeatures,
                   "Unrecognized sheet parsing mode");
 
   NS_POSTCONDITION(!mUseSystemPrincipal || mSyncLoad,