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

Unified Diff: extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.cc

Issue 2923053002: Move MainWorldScriptContext accessor/method from WebFrame to WebLocalFrame. (Closed)
Patch Set: Rebasing... Created 3 years, 6 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: extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.cc
diff --git a/extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.cc b/extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.cc
index c27ded7fa9bb86d6cdbeab43c28935b32d30aca1..14d599a2d9ae022a9db5cb3bd53855ab70aa9983 100644
--- a/extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.cc
+++ b/extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.cc
@@ -236,14 +236,7 @@ void MimeHandlerViewContainer::PostMessage(v8::Isolate* isolate,
v8::Context::Scope context_scope(
render_frame()->GetWebFrame()->MainWorldScriptContext());
- // 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::Object> guest_proxy_window;
- if (guest_proxy_frame->IsWebLocalFrame()) {
- guest_proxy_window = guest_proxy_frame->MainWorldScriptContext()->Global();
- } else {
- guest_proxy_window = guest_proxy_frame->ToWebRemoteFrame()->GlobalProxy();
- }
+ v8::Local<v8::Object> guest_proxy_window = guest_proxy_frame->GlobalProxy();
gin::Dictionary window_object(isolate, guest_proxy_window);
v8::Local<v8::Function> post_message;
if (!window_object.Get(std::string(kPostMessageName), &post_message))
@@ -261,7 +254,7 @@ void MimeHandlerViewContainer::PostMessage(v8::Isolate* isolate,
void MimeHandlerViewContainer::PostMessageFromValue(
const base::Value& message) {
- blink::WebFrame* frame = render_frame()->GetWebFrame();
+ blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
if (!frame)
return;
@@ -302,7 +295,7 @@ void MimeHandlerViewContainer::OnMimeHandlerViewGuestOnLoadCompleted(
return;
// Now that the guest has loaded, flush any unsent messages.
- blink::WebFrame* frame = render_frame()->GetWebFrame();
+ blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
if (!frame)
return;
« no previous file with comments | « extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc ('k') | extensions/renderer/runtime_custom_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698