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

Unified Diff: components/guest_view/renderer/guest_view_request.cc

Issue 1337283003: Prepare GuestView for removing swapped out RenderFrame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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: 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]);

Powered by Google App Engine
This is Rietveld 408576698