diff options
author | nasko <nasko@chromium.org> | 2015-09-14 11:33:40 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-14 18:34:18 +0000 |
commit | 89aa05ab8d8a42d2587e5ad3cc6ac245519ce588 (patch) | |
tree | 5fdc9265f5e659456c8fde7d3785e941ce409b24 /extensions/renderer/guest_view | |
parent | eb42db79c347e91bd4c63e56e2b696d4fe0869ea (diff) | |
download | chromium_src-89aa05ab8d8a42d2587e5ad3cc6ac245519ce588.zip chromium_src-89aa05ab8d8a42d2587e5ad3cc6ac245519ce588.tar.gz chromium_src-89aa05ab8d8a42d2587e5ad3cc6ac245519ce588.tar.bz2 |
Prepare GuestView for removing swapped out RenderFrame.
GuestView code is dependent on the usage of swapped out RenderFrame for
the out-of-process component. Since swapped out state is going away,
this CL removes this dependency.
BUG=357747
Review URL: https://codereview.chromium.org/1337283003
Cr-Commit-Position: refs/heads/master@{#348662}
Diffstat (limited to 'extensions/renderer/guest_view')
-rw-r--r-- | extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc b/extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc index 7eb1292..ee243bf 100644 --- a/extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc +++ b/extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc @@ -24,6 +24,7 @@ #include "extensions/renderer/script_context.h" #include "third_party/WebKit/public/web/WebFrame.h" #include "third_party/WebKit/public/web/WebLocalFrame.h" +#include "third_party/WebKit/public/web/WebRemoteFrame.h" #include "third_party/WebKit/public/web/WebScopedUserGesture.h" #include "third_party/WebKit/public/web/WebView.h" #include "v8/include/v8.h" @@ -314,7 +315,15 @@ void GuestViewInternalCustomBindings::GetContentWindow( return; blink::WebFrame* frame = 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(); + } args.GetReturnValue().Set(window); } |