diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2020-01-22 19:28:33 -0500 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2020-01-26 15:50:49 -0500 |
commit | 43a8113072b96affb2b7a3a7a4e965547d3d0c41 (patch) | |
tree | dd685edd37f2bffec27c55060e50ba8289e05760 /dom/bindings | |
parent | 14d115cfe32ab72b7193a4fb74e13c06c6d4cc8f (diff) | |
download | UXP-43a8113072b96affb2b7a3a7a4e965547d3d0c41.tar UXP-43a8113072b96affb2b7a3a7a4e965547d3d0c41.tar.gz UXP-43a8113072b96affb2b7a3a7a4e965547d3d0c41.tar.lz UXP-43a8113072b96affb2b7a3a7a4e965547d3d0c41.tar.xz UXP-43a8113072b96affb2b7a3a7a4e965547d3d0c41.zip |
Bug 1405821 - Move microtask handling to CycleCollectedJSContext
Tag UXP Issue #1344
Diffstat (limited to 'dom/bindings')
-rw-r--r-- | dom/bindings/CallbackObject.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/dom/bindings/CallbackObject.cpp b/dom/bindings/CallbackObject.cpp index bb01c804c..398acf9da 100644 --- a/dom/bindings/CallbackObject.cpp +++ b/dom/bindings/CallbackObject.cpp @@ -5,6 +5,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "mozilla/dom/CallbackObject.h" +#include "mozilla/CycleCollectedJSContext.h" #include "mozilla/dom/BindingUtils.h" #include "jsfriendapi.h" #include "nsIScriptGlobalObject.h" @@ -79,7 +80,10 @@ CallbackObject::CallSetup::CallSetup(CallbackObject* aCallback, , mIsMainThread(NS_IsMainThread()) { if (mIsMainThread) { - nsContentUtils::EnterMicroTask(); + CycleCollectedJSContext* ccjs = CycleCollectedJSContext::Get(); + if (ccjs) { + ccjs->EnterMicroTask(); + } } // Compute the caller's subject principal (if necessary) early, before we @@ -288,7 +292,10 @@ CallbackObject::CallSetup::~CallSetup() // It is important that this is the last thing we do, after leaving the // compartment and undoing all our entry/incumbent script changes if (mIsMainThread) { - nsContentUtils::LeaveMicroTask(); + CycleCollectedJSContext* ccjs = CycleCollectedJSContext::Get(); + if (ccjs) { + ccjs->LeaveMicroTask(); + } } } |