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

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

Issue 1102173002: Move GuestView layer in browser to components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Jochen's comment + GuestViewBase cleanup 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/extensions_guest_view_container.h" 5 #include "extensions/renderer/guest_view/extensions_guest_view_container.h"
6 6
7 #include "components/guest_view/common/guest_view_constants.h"
8 #include "components/guest_view/common/guest_view_messages.h"
7 #include "content/public/renderer/render_frame.h" 9 #include "content/public/renderer/render_frame.h"
8 #include "content/public/renderer/render_view.h" 10 #include "content/public/renderer/render_view.h"
9 #include "extensions/common/guest_view/guest_view_constants.h"
10 #include "extensions/common/guest_view/guest_view_messages.h"
11 #include "third_party/WebKit/public/web/WebLocalFrame.h" 11 #include "third_party/WebKit/public/web/WebLocalFrame.h"
12 #include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h" 12 #include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h"
13 #include "third_party/WebKit/public/web/WebView.h" 13 #include "third_party/WebKit/public/web/WebView.h"
14 14
15 namespace { 15 namespace {
16 typedef std::map<int, extensions::ExtensionsGuestViewContainer*> 16 typedef std::map<int, extensions::ExtensionsGuestViewContainer*>
17 ExtensionsGuestViewContainerMap; 17 ExtensionsGuestViewContainerMap;
18 static base::LazyInstance<ExtensionsGuestViewContainerMap> 18 static base::LazyInstance<ExtensionsGuestViewContainerMap>
19 g_guest_view_container_map = LAZY_INSTANCE_INITIALIZER; 19 g_guest_view_container_map = LAZY_INSTANCE_INITIALIZER;
20 } // namespace 20 } // namespace
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 ExtensionsGuestViewContainer::ExtensionsGuestViewContainer( 135 ExtensionsGuestViewContainer::ExtensionsGuestViewContainer(
136 content::RenderFrame* render_frame) 136 content::RenderFrame* render_frame)
137 : GuestViewContainer(render_frame), 137 : GuestViewContainer(render_frame),
138 ready_(false), 138 ready_(false),
139 destruction_isolate_(nullptr), 139 destruction_isolate_(nullptr),
140 element_resize_isolate_(nullptr), 140 element_resize_isolate_(nullptr),
141 weak_ptr_factory_(this) { 141 weak_ptr_factory_(this) {
142 } 142 }
143 143
144 ExtensionsGuestViewContainer::~ExtensionsGuestViewContainer() { 144 ExtensionsGuestViewContainer::~ExtensionsGuestViewContainer() {
145 if (element_instance_id() != guestview::kInstanceIDNone) 145 if (element_instance_id() != guest_view::kInstanceIDNone)
146 g_guest_view_container_map.Get().erase(element_instance_id()); 146 g_guest_view_container_map.Get().erase(element_instance_id());
147 147
148 if (pending_response_.get()) 148 if (pending_response_.get())
149 pending_response_->ExecuteCallbackIfAvailable(0 /* argc */, nullptr); 149 pending_response_->ExecuteCallbackIfAvailable(0 /* argc */, nullptr);
150 150
151 while (pending_requests_.size() > 0) { 151 while (pending_requests_.size() > 0) {
152 linked_ptr<Request> pending_request = pending_requests_.front(); 152 linked_ptr<Request> pending_request = pending_requests_.front();
153 pending_requests_.pop_front(); 153 pending_requests_.pop_front();
154 // Call the JavaScript callbacks with no arguments which implies an error. 154 // Call the JavaScript callbacks with no arguments which implies an error.
155 pending_request->ExecuteCallbackIfAvailable(0 /* argc */, nullptr); 155 pending_request->ExecuteCallbackIfAvailable(0 /* argc */, nullptr);
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 } 278 }
279 279
280 void ExtensionsGuestViewContainer::HandlePendingResponseCallback( 280 void ExtensionsGuestViewContainer::HandlePendingResponseCallback(
281 const IPC::Message& message) { 281 const IPC::Message& message) {
282 CHECK(pending_response_.get()); 282 CHECK(pending_response_.get());
283 linked_ptr<Request> pending_response(pending_response_.release()); 283 linked_ptr<Request> pending_response(pending_response_.release());
284 pending_response->HandleResponse(message); 284 pending_response->HandleResponse(message);
285 } 285 }
286 286
287 } // namespace extensions 287 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698