Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/JsEngine.cpp

Issue 29370876: Issue #4692, #3595 - Stop sleeping in the implementation of `SetTimeout`
Patch Set: Created Jan. 9, 2017, 1:22 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/GlobalJsObject.cpp ('k') | src/JsEngineInternal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/JsEngine.cpp
===================================================================
--- a/src/JsEngine.cpp
+++ b/src/JsEngine.cpp
@@ -22,6 +22,7 @@
#include "JsEngineInternal.h"
#include "JsEngineTransition.h"
#include "JsError.h"
+#include "Timeout.h"
#include "Utils.h"
#include "WebRequestJsObject.h"
@@ -377,11 +378,13 @@
{
// The present version of the scheduler only does immediate and single-use
// It does not, however, detach threads like the legacy thread behavior did.
- scheduler.Run(Task(this, std::move(body)));
+ scheduler.Run(std::forward<std::shared_ptr<TaskFunctionInterface>>(body),
+ shared_from_this());
}
void JsEngineInternal::WaitForQuietScheduler()
{
+ scheduler.ShutDown();
scheduler.JoinAll();
}
« no previous file with comments | « src/GlobalJsObject.cpp ('k') | src/JsEngineInternal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld