Title: [234854] trunk/Source/WebCore
Revision
234854
Author
[email protected]
Date
2018-08-14 10:45:09 -0700 (Tue, 14 Aug 2018)

Log Message

Unreviewed, follow-up patch for comments
https://bugs.webkit.org/show_bug.cgi?id=188265

* bindings/js/JSExecState.cpp:
(WebCore::JSExecState::didLeaveScriptContext):
Do nothing if `context` is nullptr. It is OK since we do not need to drain microtasks / rejected
promise events after ScriptExecutionContext is gone.

* dom/Microtasks.cpp:
(WebCore::MicrotaskQueue::contextQueue):
Drop unnecessary assertion since it is subsumed by downcast<>.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (234853 => 234854)


--- trunk/Source/WebCore/ChangeLog	2018-08-14 17:23:50 UTC (rev 234853)
+++ trunk/Source/WebCore/ChangeLog	2018-08-14 17:45:09 UTC (rev 234854)
@@ -1,3 +1,17 @@
+2018-08-14  Yusuke Suzuki  <[email protected]>
+
+        Unreviewed, follow-up patch for comments
+        https://bugs.webkit.org/show_bug.cgi?id=188265
+
+        * bindings/js/JSExecState.cpp:
+        (WebCore::JSExecState::didLeaveScriptContext):
+        Do nothing if `context` is nullptr. It is OK since we do not need to drain microtasks / rejected
+        promise events after ScriptExecutionContext is gone.
+
+        * dom/Microtasks.cpp:
+        (WebCore::MicrotaskQueue::contextQueue):
+        Drop unnecessary assertion since it is subsumed by downcast<>.
+
 2018-08-14  Ali Juma  <[email protected]>
 
         Follow-up: [IntersectionObserver] Implement rootMargin parsing

Modified: trunk/Source/WebCore/bindings/js/JSExecState.cpp (234853 => 234854)


--- trunk/Source/WebCore/bindings/js/JSExecState.cpp	2018-08-14 17:23:50 UTC (rev 234853)
+++ trunk/Source/WebCore/bindings/js/JSExecState.cpp	2018-08-14 17:45:09 UTC (rev 234854)
@@ -37,6 +37,8 @@
 void JSExecState::didLeaveScriptContext(JSC::ExecState* exec)
 {
     ScriptExecutionContext* context = scriptExecutionContextFromExecState(exec);
+    if (!context)
+        return;
     MicrotaskQueue::contextQueue(*context).performMicrotaskCheckpoint();
     context->ensureRejectedPromiseTracker().processQueueSoon();
 }

Modified: trunk/Source/WebCore/dom/Microtasks.cpp (234853 => 234854)


--- trunk/Source/WebCore/dom/Microtasks.cpp	2018-08-14 17:23:50 UTC (rev 234853)
+++ trunk/Source/WebCore/dom/Microtasks.cpp	2018-08-14 17:45:09 UTC (rev 234854)
@@ -55,7 +55,6 @@
     // WorkerGlobalScope.
     if (isMainThread())
         return mainThreadQueue();
-    ASSERT(context.isWorkerGlobalScope());
     return downcast<WorkerGlobalScope>(context).microtaskQueue();
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to