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

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: add basic postMessage test 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 guest_instance_id,
127 v8::Local<v8::Function> callback,
128 v8::Isolate* isolate)
129 : GuestViewRequest(container, callback, isolate),
130 guest_instance_id_(guest_instance_id) {
131 }
132
133 GuestViewAttachIframeRequest::~GuestViewAttachIframeRequest() {
134 }
135
136 void GuestViewAttachIframeRequest::PerformRequest() {
137 LOG(WARNING)
138 << "GuestViewAttachIframeRequest::PerformRequest, guest_instance_id: "
139 << guest_instance_id_;
140 // Only store callback.
141 DCHECK(container()->render_frame());
142 }
143
144 void GuestViewAttachIframeRequest::HandleResponse(const IPC::Message& message) {
145 ExtensionsGuestViewMsg_ContentWindowReady::Param param;
146 bool message_read_status =
147 ExtensionsGuestViewMsg_ContentWindowReady::Read(&message, &param);
148 DCHECK(message_read_status);
149
150 v8::HandleScope handle_scope(isolate());
151 const int argc = 0;
152 scoped_ptr<v8::Handle<v8::Value>[]> argv(new v8::Handle<v8::Value>[argc]);
153 ExecuteCallbackIfAvailable(argc, argv.Pass());
154 }
155
123 } // namespace extensions 156 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698