Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Unified Diff: Source/core/workers/WorkerRunLoop.cpp

Issue 298383002: Suspend setTimeout callbacks while dedicated worker execution is paused (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed ASSERT condition Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/inspector-protocol/debugger/suspend-setTimeout-on-pause-in-dedicated-worker-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/workers/WorkerRunLoop.cpp
diff --git a/Source/core/workers/WorkerRunLoop.cpp b/Source/core/workers/WorkerRunLoop.cpp
index 09c4d05c8af252bb544b2b04e1345f2ce195311b..538f4ac2ed3151a3878441679bf9e17e7e1ab7a6 100644
--- a/Source/core/workers/WorkerRunLoop.cpp
+++ b/Source/core/workers/WorkerRunLoop.cpp
@@ -179,6 +179,7 @@ MessageQueueWaitResult WorkerRunLoop::run(MessageQueue<blink::WebThread::Task>&
ASSERT(m_context->thread());
ASSERT(m_context->thread()->isCurrentThread());
+ bool isDebuggerQueue = (&queue == &m_debuggerMessageQueue);
bool nextTimeoutEventIsIdleWatchdog;
MessageQueueWaitResult result;
OwnPtr<blink::WebThread::Task> task;
@@ -186,7 +187,7 @@ MessageQueueWaitResult WorkerRunLoop::run(MessageQueue<blink::WebThread::Task>&
double absoluteTime = 0.0;
nextTimeoutEventIsIdleWatchdog = false;
if (waitMode == WaitForMessage) {
- absoluteTime = m_sharedTimer->isActive() ? m_sharedTimer->fireTime() : MessageQueue<blink::WebThread::Task>::infiniteTime();
+ absoluteTime = !isDebuggerQueue && m_sharedTimer->isActive() ? m_sharedTimer->fireTime() : MessageQueue<blink::WebThread::Task>::infiniteTime();
// Do a script engine idle notification if the next event is distant enough.
const double kMinIdleTimespan = 0.3; // seconds
@@ -225,6 +226,7 @@ MessageQueueWaitResult WorkerRunLoop::run(MessageQueue<blink::WebThread::Task>&
break;
case MessageQueueTimeout:
+ ASSERT(!isDebuggerQueue || waitMode != WaitForMessage);
if (!m_context->isClosing())
m_sharedTimer->fire();
break;
« no previous file with comments | « LayoutTests/inspector-protocol/debugger/suspend-setTimeout-on-pause-in-dedicated-worker-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698