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

Unified Diff: src/WebRequestJsObject.cpp

Issue 29367522: Issue #4688, #3595 - Web request use scheduled threads; unit tests terminate
Patch Set: Created Dec. 14, 2016, 8:38 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 | « no previous file | test/BaseJsTest.h » ('j') | test/BaseJsTest.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/WebRequestJsObject.cpp
===================================================================
--- a/src/WebRequestJsObject.cpp
+++ b/src/WebRequestJsObject.cpp
@@ -90,9 +90,10 @@
v8::Handle<v8::Value> GETCallback(const v8::Arguments& arguments)
{
std::shared_ptr<WebRequestTask> thread;
+ AdblockPlus::JsEnginePtr jsEngine;
try
{
- AdblockPlus::JsEnginePtr jsEngine = AdblockPlus::JsEngine::FromArguments(arguments);
+ jsEngine = AdblockPlus::JsEngine::FromArguments(arguments);
AdblockPlus::JsValueList converted = jsEngine->ConvertArguments(arguments);
if (converted.size() != 3u)
throw std::runtime_error("GET requires exactly 3 arguments");
@@ -104,7 +105,7 @@
v8::Isolate* isolate = arguments.GetIsolate();
return v8::ThrowException(ToV8String(isolate, e.what()));
}
- StartImmediatelyInSingleUseDetachedThread(AdblockPlus::MakeHeapFunction(thread));
+ jsEngine->Schedule(AdblockPlus::MakeHeapFunction(thread), AdblockPlus::ImmediateSingleUseThread);
return v8::Undefined();
}
}
« no previous file with comments | « no previous file | test/BaseJsTest.h » ('j') | test/BaseJsTest.h » ('J')

Powered by Google App Engine
This is Rietveld