Bug 1361369 - Rename some script load request flags to be more descriptive r=smaug
authorJon Coppeard <jcoppeard@mozilla.com>
Mon, 08 Jan 2018 15:17:33 +0000
changeset 450001 43b6dc38e9853bbec9cdbb70f26eaac0d9a9a04c
parent 450000 82292893549a89675e58598a5cd6a2eecc6b375f
child 450002 b8bae6e72f422f94d55dc179978b93a466250812
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1361369
milestone59.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 1361369 - Rename some script load request flags to be more descriptive r=smaug
dom/script/ScriptLoadRequest.cpp
dom/script/ScriptLoadRequest.h
dom/script/ScriptLoader.cpp
--- a/dom/script/ScriptLoadRequest.cpp
+++ b/dom/script/ScriptLoadRequest.cpp
@@ -48,18 +48,18 @@ ScriptLoadRequest::ScriptLoadRequest(Scr
                                      mozilla::net::ReferrerPolicy aReferrerPolicy)
   : mKind(aKind)
   , mElement(aElement)
   , mScriptFromHead(false)
   , mProgress(Progress::Loading)
   , mDataType(DataType::Unknown)
   , mIsInline(true)
   , mHasSourceMapURL(false)
-  , mIsDefer(false)
-  , mIsAsync(false)
+  , mInDeferList(false)
+  , mInAsyncList(false)
   , mPreloadAsAsync(false)
   , mPreloadAsDefer(false)
   , mIsNonAsyncScriptInserted(false)
   , mIsXSLT(false)
   , mIsCanceled(false)
   , mWasCompiledOMT(false)
   , mIsTracking(false)
   , mOffThreadToken(nullptr)
--- a/dom/script/ScriptLoadRequest.h
+++ b/dom/script/ScriptLoadRequest.h
@@ -158,18 +158,18 @@ public:
 
   const ScriptKind mKind;
   nsCOMPtr<nsIScriptElement> mElement;
   bool mScriptFromHead;   // Synchronous head script block loading of other non js/css content.
   Progress mProgress;     // Are we still waiting for a load to complete?
   DataType mDataType;     // Does this contain Source or Bytecode?
   bool mIsInline;         // Is the script inline or loaded?
   bool mHasSourceMapURL;  // Does the HTTP header have a source map url?
-  bool mIsDefer;          // True if we live in mDeferRequests.
-  bool mIsAsync;          // True if we live in mLoadingAsyncRequests or mLoadedAsyncRequests.
+  bool mInDeferList;      // True if we live in mDeferRequests.
+  bool mInAsyncList;      // True if we live in mLoadingAsyncRequests or mLoadedAsyncRequests.
   bool mPreloadAsAsync;   // True if this is a preload request and the script is async
   bool mPreloadAsDefer;   // True if this is a preload request and the script is defer
   bool mIsNonAsyncScriptInserted; // True if we live in mNonAsyncExternalScriptInsertedRequests
   bool mIsXSLT;           // True if we live in mXSLTRequests.
   bool mIsCanceled;       // True if we have been explicitly canceled.
   bool mWasCompiledOMT;   // True if the script has been compiled off main thread.
   bool mIsTracking;       // True if the script comes from a source on our tracking protection list.
   void* mOffThreadToken;  // Off-thread parsing token.
--- a/dom/script/ScriptLoader.cpp
+++ b/dom/script/ScriptLoader.cpp
@@ -1467,17 +1467,17 @@ ScriptLoader::ProcessScriptElement(nsISc
 
     // Should still be in loading stage of script.
     NS_ASSERTION(!request->InCompilingStage(),
                  "Request should not yet be in compiling stage.");
 
     request->mValidJSVersion = validJSVersion;
 
     if (aElement->GetScriptAsync()) {
-      request->mIsAsync = true;
+      request->mInAsyncList = true;
       if (request->IsReadyToRun()) {
         mLoadedAsyncRequests.AppendElement(request);
         // The script is available already. Run it ASAP when the event
         // loop gets a chance to spin.
 
         // KVKV TODO: Instead of processing immediately, try off-thread-parsing
         // it and only schedule a pending ProcessRequest if that fails.
         ProcessPendingRequestsAsync();
@@ -1589,20 +1589,20 @@ ScriptLoader::ProcessScriptElement(nsISc
   CollectScriptTelemetry(nullptr, request);
 
   LOG(("ScriptLoadRequest (%p): Created request for inline script",
        request.get()));
 
   if (request->IsModuleRequest()) {
     ModuleLoadRequest* modReq = request->AsModuleRequest();
     modReq->mBaseURL = mDocument->GetDocBaseURI();
-    modReq->mIsAsync = aElement->GetScriptAsync();
+    modReq->mInAsyncList = aElement->GetScriptAsync();
 
     if (aElement->GetParserCreated() != NOT_FROM_PARSER) {
-      if (modReq->mIsAsync) {
+      if (modReq->mInAsyncList) {
         mLoadingAsyncRequests.AppendElement(modReq);
       } else {
         AddDeferRequest(modReq);
       }
     }
 
     nsresult rv = ProcessFetchedModuleSource(modReq);
     if (NS_FAILED(rv)) {
@@ -2947,24 +2947,24 @@ ScriptLoader::HandleLoadError(ScriptLoad
     mDocument->AddBlockedTrackingNode(cont);
   }
 
   if (aRequest->IsModuleRequest() && !aRequest->mIsInline) {
     auto request = aRequest->AsModuleRequest();
     SetModuleFetchFinishedAndResumeWaitingRequests(request, aResult);
   }
 
-  if (aRequest->mIsDefer) {
+  if (aRequest->mInDeferList) {
     MOZ_ASSERT_IF(aRequest->IsModuleRequest(),
                   aRequest->AsModuleRequest()->IsTopLevel());
     if (aRequest->isInList()) {
       RefPtr<ScriptLoadRequest> req = mDeferRequests.Steal(aRequest);
       FireScriptAvailable(aResult, req);
     }
-  } else if (aRequest->mIsAsync) {
+  } else if (aRequest->mInAsyncList) {
     MOZ_ASSERT_IF(aRequest->IsModuleRequest(),
                   aRequest->AsModuleRequest()->IsTopLevel());
     if (aRequest->isInList()) {
       RefPtr<ScriptLoadRequest> req = mLoadingAsyncRequests.Steal(aRequest);
       FireScriptAvailable(aResult, req);
     }
   } else if (aRequest->mIsNonAsyncScriptInserted) {
     if (aRequest->isInList()) {
@@ -3026,20 +3026,20 @@ ScriptLoader::NumberOfProcessors()
   return mNumberOfProcessors;
 }
 
 void
 ScriptLoader::MaybeMoveToLoadedList(ScriptLoadRequest* aRequest)
 {
   MOZ_ASSERT(aRequest->IsReadyToRun());
 
-  // If it's async, move it to the loaded list.  aRequest->mIsAsync really
+  // If it's async, move it to the loaded list.  aRequest->mInAsyncList really
   // _should_ be in a list, but the consequences if it's not are bad enough we
   // want to avoid trying to move it if it's not.
-  if (aRequest->mIsAsync) {
+  if (aRequest->mInAsyncList) {
     MOZ_ASSERT(aRequest->isInList());
     if (aRequest->isInList()) {
       RefPtr<ScriptLoadRequest> req = mLoadingAsyncRequests.Steal(aRequest);
       mLoadedAsyncRequests.AppendElement(req);
     }
   }
 }
 
@@ -3252,17 +3252,17 @@ ScriptLoader::PreloadURI(nsIURI* aURI, c
   PreloadInfo* pi = mPreloads.AppendElement();
   pi->mRequest = request;
   pi->mCharset = aCharset;
 }
 
 void
 ScriptLoader::AddDeferRequest(ScriptLoadRequest* aRequest)
 {
-  aRequest->mIsDefer = true;
+  aRequest->mInDeferList = true;
   mDeferRequests.AppendElement(aRequest);
   if (mDeferEnabled && aRequest == mDeferRequests.getFirst() &&
       mDocument && !mBlockingDOMContentLoaded) {
     MOZ_ASSERT(mDocument->GetReadyStateEnum() == nsIDocument::READYSTATE_LOADING);
     mBlockingDOMContentLoaded = true;
     mDocument->BlockDOMContentLoaded();
   }
 }