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

Side by Side Diff: src/JsEngineInternal.h

Issue 29369557: Issue #4692 - Rewrite I/O tasks to avoid engine self-reference
Patch Set: Created Dec. 28, 2016, 5:34 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/JsEngine.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 #if !defined(ADBLOCK_PLUS_JS_ENGINE_INTERNAL_H) 2 #if !defined(ADBLOCK_PLUS_JS_ENGINE_INTERNAL_H)
3 #define ADBLOCK_PLUS_JS_ENGINE_INTERNAL_H 3 #define ADBLOCK_PLUS_JS_ENGINE_INTERNAL_H
4 4
5 #include <AdblockPlus/JsEngine.h> 5 #include <AdblockPlus/JsEngine.h>
6 #include <v8.h> 6 #include <v8.h>
7 #include <array> 7 #include <array>
8 #include "AllocatedArray.h" 8 #include "AllocatedArray.h"
9 #include "V8Upgrade.h" 9 #include "V8Upgrade.h"
10 10
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 /** 126 /**
127 * Call a function with an arbitrary object as "this" 127 * Call a function with an arbitrary object as "this"
128 * 128 *
129 * Defined as a member of the engine class as part of v8 upgrade path. 129 * Defined as a member of the engine class as part of v8 upgrade path.
130 * Newer versions of v8 require a context argument for `v8::Function::Call()`. 130 * Newer versions of v8 require a context argument for `v8::Function::Call()`.
131 */ 131 */
132 v8::Local<v8::Value> ApplyFunction( 132 v8::Local<v8::Value> ApplyFunction(
133 v8::Local<v8::Object> thisObject, 133 v8::Local<v8::Object> thisObject,
134 v8::Local<v8::Function> func, 134 v8::Local<v8::Function> func,
135 AllocatedArray<v8::Local<v8::Value>> args); 135 AllocatedArray<v8::Local<v8::Value>> args);
136
137 /**
138 * Convert a standard string to a v8 string within the present isolate.
139 */
140 v8::Local<v8::String> ToV8String(const std::string& s);
136 }; 141 };
137 142
138 /** 143 /**
139 * Sentry class setting up a multi-threaded v8 usage environment. 144 * Sentry class setting up a multi-threaded v8 usage environment.
140 * 145 *
141 * The engine has the responsibility for maintaining an isolate and a context. 146 * The engine has the responsibility for maintaining an isolate and a context.
142 * This class maintains the following: 147 * This class maintains the following:
143 * - v8 lock to ensure single-threaded JS evaluation. 148 * - v8 lock to ensure single-threaded JS evaluation.
144 * - v8 scopes for isolate, handle, and scope. 149 * - v8 scopes for isolate, handle, and scope.
145 * - shared_ptr to engine 150 * - shared_ptr to engine
(...skipping 16 matching lines...) Expand all
162 */ 167 */
163 const v8::HandleScope handleScope; 168 const v8::HandleScope handleScope;
164 const v8::Context::Scope contextScope; 169 const v8::Context::Scope contextScope;
165 public: 170 public:
166 V8ExecutionScope(JsEngineInternal* engine); 171 V8ExecutionScope(JsEngineInternal* engine);
167 }; 172 };
168 173
169 174
170 175
171 #endif 176 #endif
OLDNEW
« no previous file with comments | « src/JsEngine.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld