Index: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp |
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp |
index 91cd54ae1ec8bff1696e166fe3112d5eb6211eea..9a0206874dbcde8f6e8613341c3262cacb00682d 100644 |
--- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp |
+++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp |
@@ -98,6 +98,7 @@ |
#include "bindings/core/v8/V8Binding.h" |
#include "bindings/core/v8/V8GCController.h" |
#include "bindings/core/v8/V8PerIsolateData.h" |
+#include "bindings/core/v8/WindowProxy.h" |
#include "core/HTMLNames.h" |
#include "core/dom/Document.h" |
#include "core/dom/IconURL.h" |
@@ -847,9 +848,9 @@ v8::Local<v8::Value> WebLocalFrameImpl::callFunctionEvenIfScriptDisabled( |
} |
v8::Local<v8::Context> WebLocalFrameImpl::mainWorldScriptContext() const { |
- ScriptState* scriptState = ScriptState::forMainWorld(frame()); |
- DCHECK(scriptState); |
- return scriptState->context(); |
+ WindowProxy* windowProxy = frame()->getWindowProxyManager()->mainWorldProxy(); |
+ windowProxy->initializeIfNeeded(); |
+ return windowProxy->getScriptState()->context(); |
} |
bool WebFrame::scriptCanAccess(WebFrame* target) { |