summaryrefslogtreecommitdiffstats
path: root/dom/events/EventListenerManager.cpp
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2020-01-22 19:28:33 -0500
committerGaming4JC <g4jc@hyperbola.info>2020-01-26 15:50:49 -0500
commit43a8113072b96affb2b7a3a7a4e965547d3d0c41 (patch)
treedd685edd37f2bffec27c55060e50ba8289e05760 /dom/events/EventListenerManager.cpp
parent14d115cfe32ab72b7193a4fb74e13c06c6d4cc8f (diff)
downloadUXP-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/events/EventListenerManager.cpp')
-rw-r--r--dom/events/EventListenerManager.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/dom/events/EventListenerManager.cpp b/dom/events/EventListenerManager.cpp
index 0774c3296..2add7d009 100644
--- a/dom/events/EventListenerManager.cpp
+++ b/dom/events/EventListenerManager.cpp
@@ -1087,7 +1087,10 @@ EventListenerManager::HandleEventSubType(Listener* aListener,
if (NS_SUCCEEDED(result)) {
if (mIsMainThreadELM) {
- nsContentUtils::EnterMicroTask();
+ CycleCollectedJSContext* ccjs = CycleCollectedJSContext::Get();
+ if (ccjs) {
+ ccjs->EnterMicroTask();
+ }
}
// nsIDOMEvent::currentTarget is set in EventDispatcher.
if (listenerHolder.HasWebIDLCallback()) {
@@ -1099,7 +1102,10 @@ EventListenerManager::HandleEventSubType(Listener* aListener,
result = listenerHolder.GetXPCOMCallback()->HandleEvent(aDOMEvent);
}
if (mIsMainThreadELM) {
- nsContentUtils::LeaveMicroTask();
+ CycleCollectedJSContext* ccjs = CycleCollectedJSContext::Get();
+ if (ccjs) {
+ ccjs->LeaveMicroTask();
+ }
}
}