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

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: Added TODO comments. 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
« no previous file with comments | « no previous file | extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2a4fd3157bcd678ebdd00cfd01cbd983333ba6e3 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,15 @@ 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();
+ // TODO(lazyboy,nasko): The WebLocalFrame branch is not used when running
+ // on top of out-of-process iframes. Remove it once the code is converted.
+ v8::Local<v8::Value> window;
+ if (frame->isWebLocalFrame()) {
+ 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]);
« no previous file with comments | « no previous file | extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698