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

Unified Diff: Source/bindings/v8/WorkerScriptController.cpp

Issue 270873005: Initializes the context of WorkerScriptController before calling willEvaluateWorkerScript. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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
« no previous file with comments | « Source/bindings/v8/WorkerScriptController.h ('k') | Source/core/workers/WorkerThread.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/WorkerScriptController.cpp
diff --git a/Source/bindings/v8/WorkerScriptController.cpp b/Source/bindings/v8/WorkerScriptController.cpp
index 6a07e3a1f7759a88d7a52e482a503997926fcc0a..89931f3d6613b4e4d9d40ff938a0126740dd8d07 100644
--- a/Source/bindings/v8/WorkerScriptController.cpp
+++ b/Source/bindings/v8/WorkerScriptController.cpp
@@ -113,7 +113,7 @@ WorkerScriptController::~WorkerScriptController()
ThreadState::current()->addCleanupTask(IsolateCleanupTask::create(m_isolate));
}
-bool WorkerScriptController::initializeContextIfNeeded()
+bool WorkerScriptController::initializeContext()
{
v8::HandleScope handleScope(m_isolate);
@@ -155,8 +155,7 @@ bool WorkerScriptController::initializeContextIfNeeded()
ScriptValue WorkerScriptController::evaluate(const String& script, const String& fileName, const TextPosition& scriptStartPosition, WorkerGlobalScopeExecutionState* state)
{
- if (!initializeContextIfNeeded())
- return ScriptValue();
+ ASSERT(isContextInitialized());
haraken 2014/05/09 10:03:22 I think it's OK to call initializeContext from Wor
horo 2014/05/09 10:22:00 That sounds reasonable. Done.
ScriptState::Scope scope(m_scriptState.get());
« no previous file with comments | « Source/bindings/v8/WorkerScriptController.h ('k') | Source/core/workers/WorkerThread.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698