diff options
Diffstat (limited to 'chromium/third_party/WebKit/Source/bindings/v8/WorkerScriptController.h')
-rw-r--r-- | chromium/third_party/WebKit/Source/bindings/v8/WorkerScriptController.h | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/chromium/third_party/WebKit/Source/bindings/v8/WorkerScriptController.h b/chromium/third_party/WebKit/Source/bindings/v8/WorkerScriptController.h index 7b7ea1af507..2559269fdd0 100644 --- a/chromium/third_party/WebKit/Source/bindings/v8/WorkerScriptController.h +++ b/chromium/third_party/WebKit/Source/bindings/v8/WorkerScriptController.h @@ -34,17 +34,11 @@ #include "bindings/v8/ScriptValue.h" #include "bindings/v8/V8Binding.h" #include "core/events/ErrorEvent.h" -#include "gin/public/context_holder.h" -#include "gin/public/isolate_holder.h" #include "wtf/OwnPtr.h" #include "wtf/ThreadingPrimitives.h" #include "wtf/text/TextPosition.h" #include <v8.h> -namespace gin { -class IsolateHolder; -} - namespace WebCore { class ScriptSourceCode; @@ -74,9 +68,11 @@ namespace WebCore { WorkerGlobalScope& workerGlobalScope() { return m_workerGlobalScope; } - void evaluate(const ScriptSourceCode&, RefPtr<ErrorEvent>* = 0); + bool initializeContextIfNeeded(); + + void evaluate(const ScriptSourceCode&, RefPtrWillBeRawPtr<ErrorEvent>* = 0); - void rethrowExceptionFromImportedScript(PassRefPtr<ErrorEvent>); + void rethrowExceptionFromImportedScript(PassRefPtrWillBeRawPtr<ErrorEvent>); // Async request to terminate a future JS execution. Eventually causes termination // exception raised during JS execution, if the worker thread happens to run JS. @@ -93,36 +89,32 @@ namespace WebCore { void disableEval(const String&); - // Returns WorkerScriptController for the currently executing context. 0 will be returned if the current executing context is not the worker context. - static WorkerScriptController* controllerForContext(); - // Evaluate a script file in the current execution environment. ScriptValue evaluate(const String& script, const String& fileName, const TextPosition& scriptStartPosition, WorkerGlobalScopeExecutionState*); - // Returns a local handle of the context. - v8::Local<v8::Context> context() { return m_contextHolder ? m_contextHolder->context() : v8::Local<v8::Context>(); } + v8::Isolate* isolate() const { return m_isolate; } + DOMWrapperWorld& world() const { return *m_world; } + ScriptState* scriptState() { return m_scriptState.get(); } + v8::Local<v8::Context> context() { return m_scriptState ? m_scriptState->context() : v8::Local<v8::Context>(); } + bool isContextInitialized() { return m_scriptState && !!m_scriptState->perContextData(); } // Send a notification about current thread is going to be idle. // Returns true if the embedder should stop calling idleNotification // until real work has been done. bool idleNotification() { return v8::V8::IdleNotification(); } - v8::Isolate* isolate() const { return m_isolateHolder->isolate(); } private: - bool initializeContextIfNeeded(); - void disposeContext(); - + v8::Isolate* m_isolate; WorkerGlobalScope& m_workerGlobalScope; - OwnPtr<gin::IsolateHolder> m_isolateHolder; - OwnPtr<gin::ContextHolder> m_contextHolder; - OwnPtr<V8PerContextData> m_perContextData; + RefPtr<ScriptState> m_scriptState; + RefPtr<DOMWrapperWorld> m_world; String m_disableEvalPending; - OwnPtr<DOMDataStore> m_domDataStore; bool m_executionForbidden; bool m_executionScheduledToTerminate; mutable Mutex m_scheduledTerminationMutex; - RefPtr<ErrorEvent> m_errorEventFromImportedScript; + RefPtrWillBePersistent<ErrorEvent> m_errorEventFromImportedScript; + OwnPtr<V8IsolateInterruptor> m_interruptor; }; } // namespace WebCore |