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

Unified Diff: Source/bindings/core/v8/WorkerScriptController.h

Issue 404513002: Propagate nested importScripts() error events outwards. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use STACK_ALLOCATED() Created 6 years, 5 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: Source/bindings/core/v8/WorkerScriptController.h
diff --git a/Source/bindings/core/v8/WorkerScriptController.h b/Source/bindings/core/v8/WorkerScriptController.h
index f25230d75d880cfcd37a4e36455748fc780439ba..eaa801f7459ad52a11843d225f6ce6b07afadaca 100644
--- a/Source/bindings/core/v8/WorkerScriptController.h
+++ b/Source/bindings/core/v8/WorkerScriptController.h
@@ -41,25 +41,11 @@
namespace WebCore {
class ErrorEvent;
+class ExceptionState;
class ScriptSourceCode;
class ScriptValue;
class WorkerGlobalScope;
-
-struct WorkerGlobalScopeExecutionState {
- WorkerGlobalScopeExecutionState()
- : hadException(false)
- , lineNumber(0)
- , columnNumber(0)
- {
- }
-
- bool hadException;
- String errorMessage;
- int lineNumber;
- int columnNumber;
- String sourceURL;
- ScriptValue exception;
-};
+class WorkerGlobalScopeExecutionState;
class WorkerScriptController {
public:
@@ -72,7 +58,7 @@ public:
void evaluate(const ScriptSourceCode&, RefPtrWillBeRawPtr<ErrorEvent>* = 0);
- void rethrowExceptionFromImportedScript(PassRefPtrWillBeRawPtr<ErrorEvent>);
+ void rethrowExceptionFromImportedScript(PassRefPtrWillBeRawPtr<ErrorEvent>, ExceptionState&);
// Async request to terminate a future JS execution. Eventually causes termination
// exception raised during JS execution, if the worker thread happens to run JS.
@@ -89,9 +75,6 @@ public:
void disableEval(const String&);
- // Evaluate a script file in the current execution environment.
- ScriptValue evaluate(const String& script, const String& fileName, const TextPosition& scriptStartPosition, WorkerGlobalScopeExecutionState*);
-
v8::Isolate* isolate() const { return m_isolate; }
DOMWrapperWorld& world() const { return *m_world; }
ScriptState* scriptState() { return m_scriptState.get(); }
@@ -103,8 +86,12 @@ public:
// until real work has been done.
bool idleNotification() { return v8::V8::IdleNotification(); }
-
private:
+ class WorkerGlobalScopeExecutionState;
+
+ // Evaluate a script file in the current execution environment.
+ ScriptValue evaluate(const String& script, const String& fileName, const TextPosition& scriptStartPosition);
+
v8::Isolate* m_isolate;
WorkerGlobalScope& m_workerGlobalScope;
RefPtr<ScriptState> m_scriptState;
@@ -113,7 +100,15 @@ private:
bool m_executionForbidden;
bool m_executionScheduledToTerminate;
mutable Mutex m_scheduledTerminationMutex;
- RefPtrWillBePersistent<ErrorEvent> m_errorEventFromImportedScript;
+
+ // |m_globalScopeExecutionState| refers to a stack object
+ // that evaluate() allocates; evaluate() ensuring that the
+ // pointer reference to it is removed upon returning. Hence
+ // kept as a bare pointer here, and not a Persistent with
+ // Oilpan enabled; stack scanning will visit the object and
+ // trace its on-heap fields.
+ GC_PLUGIN_IGNORE("394615")
+ WorkerGlobalScopeExecutionState* m_globalScopeExecutionState;
OwnPtr<V8IsolateInterruptor> m_interruptor;
};

Powered by Google App Engine
This is Rietveld 408576698