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

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

Issue 972313002: Make <webview> use out-of-process iframe architecture. (Closed) Base URL: ssh://saopaulo.wat/mnt/dev/shared/src@testoopif2z-better-chrome
Patch Set: address all comments from Nasko and Charlie, minus is_loading Created 5 years, 7 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
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 "extensions/renderer/guest_view/guest_view_request.h" 5 #include "extensions/renderer/guest_view/guest_view_request.h"
6 6
7 #include "components/guest_view/common/guest_view_messages.h" 7 #include "components/guest_view/common/guest_view_messages.h"
8 #include "content/public/renderer/render_frame.h" 8 #include "content/public/renderer/render_frame.h"
9 #include "content/public/renderer/render_view.h" 9 #include "content/public/renderer/render_view.h"
10 #include "extensions/common/guest_view/extensions_guest_view_messages.h"
10 #include "extensions/renderer/guest_view/guest_view_container.h" 11 #include "extensions/renderer/guest_view/guest_view_container.h"
11 #include "third_party/WebKit/public/web/WebLocalFrame.h" 12 #include "third_party/WebKit/public/web/WebLocalFrame.h"
12 #include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h" 13 #include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h"
13 #include "third_party/WebKit/public/web/WebView.h" 14 #include "third_party/WebKit/public/web/WebView.h"
14 15
15 namespace extensions { 16 namespace extensions {
16 17
17 GuestViewRequest::GuestViewRequest(GuestViewContainer* container, 18 GuestViewRequest::GuestViewRequest(GuestViewContainer* container,
18 v8::Local<v8::Function> callback, 19 v8::Local<v8::Function> callback,
19 v8::Isolate* isolate) 20 v8::Isolate* isolate)
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 if (!container()->render_frame()) 114 if (!container()->render_frame())
114 return; 115 return;
115 116
116 container()->render_frame()->DetachGuest(container()->element_instance_id()); 117 container()->render_frame()->DetachGuest(container()->element_instance_id());
117 } 118 }
118 119
119 void GuestViewDetachRequest::HandleResponse(const IPC::Message& message) { 120 void GuestViewDetachRequest::HandleResponse(const IPC::Message& message) {
120 ExecuteCallbackIfAvailable(0 /* argc */, nullptr); 121 ExecuteCallbackIfAvailable(0 /* argc */, nullptr);
121 } 122 }
122 123
124 GuestViewAttachIframeRequest::GuestViewAttachIframeRequest(
125 GuestViewContainer* container,
126 int render_frame_routing_id,
127 int guest_instance_id,
128 scoped_ptr<base::DictionaryValue> params,
129 v8::Local<v8::Function> callback,
130 v8::Isolate* isolate)
131 : GuestViewRequest(container, callback, isolate),
132 render_frame_routing_id_(render_frame_routing_id),
133 guest_instance_id_(guest_instance_id),
134 params_(params.Pass()) {
135 }
136
137 GuestViewAttachIframeRequest::~GuestViewAttachIframeRequest() {
138 }
139
140 void GuestViewAttachIframeRequest::PerformRequest() {
141 LOG(WARNING)
142 << "GuestViewAttachIframeRequest::PerformRequest, guest_instance_id: "
143 << guest_instance_id_;
144 // Only store callback.
145 DCHECK(container()->render_frame());
146
147 container()->render_frame()->Send(
148 new ExtensionsGuestViewHostMsg_AttachToEmbedderFrame(
149 render_frame_routing_id_, container()->element_instance_id(),
150 guest_instance_id_, *params_));
151 }
152
153 void GuestViewAttachIframeRequest::HandleResponse(const IPC::Message& message) {
154 ExtensionsGuestViewMsg_GuestReady::Param param;
155 bool message_read_status =
156 ExtensionsGuestViewMsg_GuestReady::Read(&message, &param);
Fady Samuel 2015/05/26 16:42:15 Why is this an ExtensionsGuestViewMsg?
157 DCHECK(message_read_status);
158
159 ExecuteCallbackIfAvailable(0, nullptr);
160 }
161
123 } // namespace extensions 162 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698