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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.h

Issue 1535943005: Initial implementation of bindings and basic classes for worklets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address (most) comments. Created 4 years, 11 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
Index: third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.h b/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.h
index 91c87937b8d7064511408947c9e59886f51dabdb..222cbe47d28841c777946322359fb9ed74257b10 100644
--- a/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.h
+++ b/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.h
@@ -46,15 +46,16 @@ namespace blink {
class CachedMetadataHandler;
class ErrorEvent;
+class ExecutionContext;
class ExceptionState;
class ScriptSourceCode;
-class WorkerGlobalScope;
+class ScriptWrappable;
class CORE_EXPORT WorkerOrWorkletScriptController : public NoBaseWillBeGarbageCollectedFinalized<WorkerOrWorkletScriptController> {
USING_FAST_MALLOC_WILL_BE_REMOVED(WorkerOrWorkletScriptController);
WTF_MAKE_NONCOPYABLE(WorkerOrWorkletScriptController);
public:
- static PassOwnPtrWillBeRawPtr<WorkerOrWorkletScriptController> create(WorkerGlobalScope*, v8::Isolate*);
+ static PassOwnPtrWillBeRawPtr<WorkerOrWorkletScriptController> create(ExecutionContext*, ScriptWrappable*, v8::Isolate*);
virtual ~WorkerOrWorkletScriptController();
void dispose();
@@ -94,15 +95,20 @@ public:
bool isContextInitialized() const { return m_scriptState && !!m_scriptState->perContextData(); }
private:
- WorkerOrWorkletScriptController(WorkerGlobalScope*, v8::Isolate*);
+ WorkerOrWorkletScriptController(ExecutionContext*, ScriptWrappable*, v8::Isolate*);
class ExecutionState;
- v8::Isolate* isolate() const;
-
// Evaluate a script file in the current execution environment.
ScriptValue evaluate(const String& script, const String& fileName, const TextPosition& scriptStartPosition, CachedMetadataHandler*, V8CacheOptions);
- RawPtrWillBeMember<WorkerGlobalScope> m_workerGlobalScope;
+ RawPtrWillBeMember<ExecutionContext> m_executionContext;
+ ScriptWrappable* m_scriptWrappable;
+
+ // The v8 isolate associated to the (worker or worklet) global scope. For
+ // workers this should be the worker thread's isolate, while for worklets
+ // usually the main thread's isolate is used.
+ v8::Isolate* m_isolate;
+
RefPtr<ScriptState> m_scriptState;
RefPtr<DOMWrapperWorld> m_world;
String m_disableEvalPending;

Powered by Google App Engine
This is Rietveld 408576698