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

Unified Diff: src/JsEngine.cpp

Issue 29369520: Issue #4692 - Rewrite web request task to avoid engine self-reference
Patch Set: Created Dec. 24, 2016, 4:58 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/JsValue.cpp » ('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
@@ -23,6 +23,7 @@
#include "JsError.h"
#include "Scheduler.h"
#include "Utils.h"
+#include "WebRequestJsObject.h"
const AdblockPlus::ImmediateSingleUseThreadType AdblockPlus::ImmediateSingleUseThread = {};
@@ -109,8 +110,15 @@
*/
const v8::Context::Scope contextScope(GetContextAsLocal());
auto globalObject = GetGlobalObject();
+ // Timeout
auto propertyName = AdblockPlus::Utils::ToV8String(GetIsolate(), "setTimeout");
globalObject->Set(propertyName, MakeCallback(::CallbackForSetTimeout));
+ // Web request
+ auto auxiliaryObject = v8::Object::New();
+ propertyName = AdblockPlus::Utils::ToV8String(GetIsolate(), "GET");
+ auxiliaryObject->Set(propertyName, MakeCallback(::GETCallback));
+ propertyName = AdblockPlus::Utils::ToV8String(GetIsolate(), "_webRequest");
+ globalObject->Set(propertyName, auxiliaryObject);
// TODO: Move the rest of the global object initializations here
}
« no previous file with comments | « src/GlobalJsObject.cpp ('k') | src/JsValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld