Bug 1149891 - Backout bug 1081038 because it made us run mutation observer callbacks against the spec, part 1. r=bholley, a=dveditz
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Fri, 29 May 2015 19:10:19 +0300
changeset 266140 0bf9b7602fec
parent 266139 ceac3b53900f
child 266141 c4a3e88135e9
push id4765
push userryanvm@gmail.com
push date2015-05-30 14:25 +0000
treeherdermozilla-beta@c4a3e88135e9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley, dveditz
bugs1149891, 1081038
milestone39.0
Bug 1149891 - Backout bug 1081038 because it made us run mutation observer callbacks against the spec, part 1. r=bholley, a=dveditz
dom/base/ScriptSettings.cpp
dom/base/ScriptSettings.h
--- a/dom/base/ScriptSettings.cpp
+++ b/dom/base/ScriptSettings.cpp
@@ -524,24 +524,20 @@ AutoJSAPI::StealException(JS::MutableHan
 AutoEntryScript::AutoEntryScript(nsIGlobalObject* aGlobalObject,
                                  bool aIsMainThread,
                                  JSContext* aCx)
   : AutoJSAPI(aGlobalObject, aIsMainThread,
               aCx ? aCx : FindJSContext(aGlobalObject))
   , ScriptSettingsStackEntry(aGlobalObject, /* aCandidate = */ true)
   , mWebIDLCallerPrincipal(nullptr)
   , mDocShellForJSRunToCompletion(nullptr)
-  , mIsMainThread(aIsMainThread)
 {
   MOZ_ASSERT(aGlobalObject);
   MOZ_ASSERT_IF(!aCx, aIsMainThread); // cx is mandatory off-main-thread.
   MOZ_ASSERT_IF(aCx && aIsMainThread, aCx == FindJSContext(aGlobalObject));
-  if (aIsMainThread) {
-    nsContentUtils::EnterMicroTask();
-  }
 
   if (aIsMainThread && gRunToCompletionListeners > 0) {
     nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aGlobalObject);
     if (window) {
         mDocShellForJSRunToCompletion = window->GetDocShell();
     }
   }
 
@@ -551,20 +547,16 @@ AutoEntryScript::AutoEntryScript(nsIGlob
 }
 
 AutoEntryScript::~AutoEntryScript()
 {
   if (mDocShellForJSRunToCompletion) {
     mDocShellForJSRunToCompletion->NotifyJSRunToCompletionStop();
   }
 
-  if (mIsMainThread) {
-    nsContentUtils::LeaveMicroTask();
-  }
-
   // GC when we pop a script entry point. This is a useful heuristic that helps
   // us out on certain (flawed) benchmarks like sunspider, because it lets us
   // avoid GCing during the timing loop.
   JS_MaybeGC(cx());
 }
 
 AutoIncumbentScript::AutoIncumbentScript(nsIGlobalObject* aGlobalObject)
   : ScriptSettingsStackEntry(aGlobalObject, /* aCandidate = */ false)
--- a/dom/base/ScriptSettings.h
+++ b/dom/base/ScriptSettings.h
@@ -340,18 +340,16 @@ private:
   // the aIsJSImplementedWebIDL case.  And in that case, the subject principal
   // is the principal of the callee function that is part of the CallArgs just a
   // bit up the stack, and which will outlive us.  So we know the principal
   // can't go away until then either.
   nsIPrincipal* MOZ_NON_OWNING_REF mWebIDLCallerPrincipal;
   friend nsIPrincipal* GetWebIDLCallerPrincipal();
 
   nsCOMPtr<nsIDocShell> mDocShellForJSRunToCompletion;
-
-  bool mIsMainThread;
 };
 
 /*
  * A class that can be used to force a particular incumbent script on the stack.
  */
 class AutoIncumbentScript : protected ScriptSettingsStackEntry {
 public:
   explicit AutoIncumbentScript(nsIGlobalObject* aGlobalObject);