Index: components/guest_view/renderer/guest_view_request.cc |
diff --git a/components/guest_view/renderer/guest_view_request.cc b/components/guest_view/renderer/guest_view_request.cc |
index f666c1c5dc73ac9c8f94896e491ca1a2088f378b..b2e0e01ef300544b1883239f893fd4c9874f6a6d 100644 |
--- a/components/guest_view/renderer/guest_view_request.cc |
+++ b/components/guest_view/renderer/guest_view_request.cc |
@@ -9,6 +9,7 @@ |
#include "content/public/renderer/render_frame.h" |
#include "content/public/renderer/render_view.h" |
#include "third_party/WebKit/public/web/WebLocalFrame.h" |
+#include "third_party/WebKit/public/web/WebRemoteFrame.h" |
#include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h" |
#include "third_party/WebKit/public/web/WebView.h" |
@@ -88,7 +89,13 @@ void GuestViewAttachRequest::HandleResponse(const IPC::Message& message) { |
v8::HandleScope handle_scope(isolate()); |
blink::WebFrame* frame = guest_proxy_render_view->GetWebView()->mainFrame(); |
- v8::Local<v8::Value> window = frame->mainWorldScriptContext()->Global(); |
+ v8::Local<v8::Value> window; |
+ if (frame->isWebLocalFrame()) { |
Fady Samuel
2015/09/14 15:42:46
nit: comment would be helpful.
|
+ window = frame->mainWorldScriptContext()->Global(); |
+ } else { |
+ window = |
+ frame->toWebRemoteFrame()->deprecatedMainWorldScriptContext()->Global(); |
+ } |
const int argc = 1; |
scoped_ptr<v8::Local<v8::Value>[]> argv(new v8::Local<v8::Value>[argc]); |