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/base/nsDocument.cpp | |
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/base/nsDocument.cpp')
-rw-r--r-- | dom/base/nsDocument.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index f3e492589..293e48eb0 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -12610,8 +12610,12 @@ MarkDocumentTreeToBeInSyncOperation(nsIDocument* aDoc, void* aData) nsAutoSyncOperation::nsAutoSyncOperation(nsIDocument* aDoc) { - mMicroTaskLevel = nsContentUtils::MicroTaskLevel(); - nsContentUtils::SetMicroTaskLevel(0); + mMicroTaskLevel = 0; + CycleCollectedJSContext* ccjs = CycleCollectedJSContext::Get(); + if (ccjs) { + mMicroTaskLevel = ccjs->MicroTaskLevel(); + ccjs->SetMicroTaskLevel(0); + } if (aDoc) { if (nsPIDOMWindowOuter* win = aDoc->GetWindow()) { if (nsCOMPtr<nsPIDOMWindowOuter> top = win->GetTop()) { @@ -12627,7 +12631,10 @@ nsAutoSyncOperation::~nsAutoSyncOperation() for (int32_t i = 0; i < mDocuments.Count(); ++i) { mDocuments[i]->SetIsInSyncOperation(false); } - nsContentUtils::SetMicroTaskLevel(mMicroTaskLevel); + CycleCollectedJSContext* ccjs = CycleCollectedJSContext::Get(); + if (ccjs) { + ccjs->SetMicroTaskLevel(mMicroTaskLevel); + } } gfxUserFontSet* |