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

Side by Side Diff: components/guest_view/renderer/guest_view_request.cc

Issue 2720973002: Switch RemoteWindowProxy to use v8::Context::NewRemoteContext. (Closed)
Patch Set: Rebase after split Created 3 years, 9 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/guest_view/renderer/guest_view_request.h" 5 #include "components/guest_view/renderer/guest_view_request.h"
6 6
7 #include <tuple> 7 #include <tuple>
8 #include <utility> 8 #include <utility>
9 9
10 #include "components/guest_view/common/guest_view_messages.h" 10 #include "components/guest_view/common/guest_view_messages.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 return; 90 return;
91 91
92 v8::HandleScope handle_scope(isolate()); 92 v8::HandleScope handle_scope(isolate());
93 blink::WebFrame* frame = guest_proxy_render_view->GetWebView()->mainFrame(); 93 blink::WebFrame* frame = guest_proxy_render_view->GetWebView()->mainFrame();
94 // TODO(lazyboy,nasko): The WebLocalFrame branch is not used when running 94 // TODO(lazyboy,nasko): The WebLocalFrame branch is not used when running
95 // on top of out-of-process iframes. Remove it once the code is converted. 95 // on top of out-of-process iframes. Remove it once the code is converted.
96 v8::Local<v8::Value> window; 96 v8::Local<v8::Value> window;
97 if (frame->isWebLocalFrame()) { 97 if (frame->isWebLocalFrame()) {
98 window = frame->mainWorldScriptContext()->Global(); 98 window = frame->mainWorldScriptContext()->Global();
99 } else { 99 } else {
100 window = 100 window = frame->toWebRemoteFrame()->globalProxy();
101 frame->toWebRemoteFrame()->deprecatedMainWorldScriptContext()->Global();
102 } 101 }
103 102
104 const int argc = 1; 103 const int argc = 1;
105 std::unique_ptr<v8::Local<v8::Value>[]> argv(new v8::Local<v8::Value>[argc]); 104 std::unique_ptr<v8::Local<v8::Value>[]> argv(new v8::Local<v8::Value>[argc]);
106 argv[0] = window; 105 argv[0] = window;
107 106
108 // Call the AttachGuest API's callback with the guest proxy as the first 107 // Call the AttachGuest API's callback with the guest proxy as the first
109 // parameter. 108 // parameter.
110 ExecuteCallbackIfAvailable(argc, std::move(argv)); 109 ExecuteCallbackIfAvailable(argc, std::move(argv));
111 } 110 }
(...skipping 14 matching lines...) Expand all
126 125
127 container()->render_frame()->DetachGuest(container()->element_instance_id()); 126 container()->render_frame()->DetachGuest(container()->element_instance_id());
128 } 127 }
129 128
130 void GuestViewDetachRequest::HandleResponse(const IPC::Message& message) { 129 void GuestViewDetachRequest::HandleResponse(const IPC::Message& message) {
131 DCHECK(message.type() == GuestViewMsg_GuestDetached::ID); 130 DCHECK(message.type() == GuestViewMsg_GuestDetached::ID);
132 ExecuteCallbackIfAvailable(0 /* argc */, nullptr); 131 ExecuteCallbackIfAvailable(0 /* argc */, nullptr);
133 } 132 }
134 133
135 } // namespace guest_view 134 } // namespace guest_view
OLDNEW
« 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