Commit f1a40023 authored by dominicc@chromium.org's avatar dominicc@chromium.org

Remove unused members from WorkerScriptController.

Also clarify some comments (I'm not sure why this needs this stuff
callable from any thread anyway) and organize the members by user.

BUG=

Review URL: https://codereview.chromium.org/553553002

git-svn-id: svn://svn.chromium.org/blink/trunk@181513 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent eceddb25
...@@ -43,52 +43,50 @@ namespace blink { ...@@ -43,52 +43,50 @@ namespace blink {
class ErrorEvent; class ErrorEvent;
class ExceptionState; class ExceptionState;
class ScriptSourceCode; class ScriptSourceCode;
class ScriptValue;
class WorkerGlobalScope; class WorkerGlobalScope;
class WorkerGlobalScopeExecutionState;
class WorkerScriptController { class WorkerScriptController {
public: public:
explicit WorkerScriptController(WorkerGlobalScope&); explicit WorkerScriptController(WorkerGlobalScope&);
~WorkerScriptController(); ~WorkerScriptController();
WorkerGlobalScope& workerGlobalScope() { return m_workerGlobalScope; } bool isExecutionForbidden() const;
bool isExecutionTerminating() const;
bool initializeContextIfNeeded();
void evaluate(const ScriptSourceCode&, RefPtrWillBeRawPtr<ErrorEvent>* = 0); void evaluate(const ScriptSourceCode&, RefPtrWillBeRawPtr<ErrorEvent>* = 0);
void rethrowExceptionFromImportedScript(PassRefPtrWillBeRawPtr<ErrorEvent>, ExceptionState&); // Prevents future JavaScript execution. See
// scheduleExecutionTermination, isExecutionForbidden.
void forbidExecution();
// Async request to terminate a future JS execution. Eventually causes termination // Used by WorkerThread:
// exception raised during JS execution, if the worker thread happens to run JS. bool initializeContextIfNeeded();
// After JS execution was terminated in this way, the Worker thread has to use // Async request to terminate future JavaScript execution on the
// forbidExecution()/isExecutionForbidden() to guard against reentry into JS. // worker thread. JavaScript evaluation exits with a
// Can be called from any thread. // non-continuable exception and WorkerScriptController calls
// forbidExecution to prevent further JavaScript execution. Use
// forbidExecution()/isExecutionForbidden() to guard against
// reentry into JavaScript.
void scheduleExecutionTermination(); void scheduleExecutionTermination();
bool isExecutionTerminating() const;
// Called on Worker thread when JS exits with termination exception caused by forbidExecution() request,
// or by Worker thread termination code to prevent future entry into JS.
void forbidExecution();
bool isExecutionForbidden() const;
// Used by WorkerGlobalScope:
void rethrowExceptionFromImportedScript(PassRefPtrWillBeRawPtr<ErrorEvent>, ExceptionState&);
void disableEval(const String&); void disableEval(const String&);
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. // Send a notification about current thread is going to be idle.
// Returns true if the embedder should stop calling idleNotification // Returns true if the embedder should stop calling idleNotification
// until real work has been done. // until real work has been done.
bool idleNotification() { return m_isolate->IdleNotification(1000); } bool idleNotification() { return m_isolate->IdleNotification(1000); }
// Used by Inspector agents:
ScriptState* scriptState() { return m_scriptState.get(); }
// Used by V8 bindings:
v8::Local<v8::Context> context() { return m_scriptState ? m_scriptState->context() : v8::Local<v8::Context>(); }
private: private:
class WorkerGlobalScopeExecutionState; class WorkerGlobalScopeExecutionState;
bool isContextInitialized() { return m_scriptState && !!m_scriptState->perContextData(); }
// Evaluate a script file in the current execution environment. // Evaluate a script file in the current execution environment.
ScriptValue evaluate(const String& script, const String& fileName, const TextPosition& scriptStartPosition); ScriptValue evaluate(const String& script, const String& fileName, const TextPosition& scriptStartPosition);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment