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

Unified Diff: Source/bindings/core/v8/ScriptController.cpp

Issue 388913004: evaluateScriptInMainWorld() should check if the target context exists before evaluating a script (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/ScriptController.cpp
diff --git a/Source/bindings/core/v8/ScriptController.cpp b/Source/bindings/core/v8/ScriptController.cpp
index b96443c89dc34cd3cd32e14db2ccd1d4354a1646..a7b2b1c84f729500b619f731fd3250ae2ece934f 100644
--- a/Source/bindings/core/v8/ScriptController.cpp
+++ b/Source/bindings/core/v8/ScriptController.cpp
@@ -583,11 +583,12 @@ v8::Local<v8::Value> ScriptController::evaluateScriptInMainWorld(const ScriptSou
const String* savedSourceURL = m_sourceURL;
m_sourceURL = &sourceURL;
- ScriptState* scriptState = ScriptState::forMainWorld(m_frame);
- if (scriptState->contextIsEmpty())
+ v8::EscapableHandleScope handleScope(m_isolate);
+ v8::Handle<v8::Context> context = toV8Context(m_frame, DOMWrapperWorld::mainWorld());
+ if (context.IsEmpty())
return v8::Local<v8::Value>();
- v8::EscapableHandleScope handleScope(scriptState->isolate());
+ ScriptState* scriptState = ScriptState::from(context);
ScriptState::Scope scope(scriptState);
RefPtr<LocalFrame> protect(m_frame);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698