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

Side by Side Diff: chrome/browser/guest_view/guest_view_base.cc

Issue 264943006: BrowserPlugin: Simplify content/public API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@guestview_manager_v1
Patch Set: Fixed nit Created 6 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 "chrome/browser/guest_view/guest_view_base.h" 5 #include "chrome/browser/guest_view/guest_view_base.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "chrome/browser/guest_view/ad_view/ad_view_guest.h" 8 #include "chrome/browser/guest_view/ad_view/ad_view_guest.h"
9 #include "chrome/browser/guest_view/guest_view_constants.h" 9 #include "chrome/browser/guest_view/guest_view_constants.h"
10 #include "chrome/browser/guest_view/guest_view_manager.h" 10 #include "chrome/browser/guest_view/guest_view_manager.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 // static 80 // static
81 GuestViewBase* GuestViewBase::From(int embedder_process_id, 81 GuestViewBase* GuestViewBase::From(int embedder_process_id,
82 int guest_instance_id) { 82 int guest_instance_id) {
83 content::RenderProcessHost* host = 83 content::RenderProcessHost* host =
84 content::RenderProcessHost::FromID(embedder_process_id); 84 content::RenderProcessHost::FromID(embedder_process_id);
85 if (!host) 85 if (!host)
86 return NULL; 86 return NULL;
87 87
88 content::WebContents* guest_web_contents = 88 content::WebContents* guest_web_contents =
89 GuestViewManager::FromBrowserContext(host->GetBrowserContext())-> 89 GuestViewManager::FromBrowserContext(host->GetBrowserContext())->
90 GetGuestByInstanceID(guest_instance_id, embedder_process_id); 90 GetGuestByInstanceIDSafely(guest_instance_id, embedder_process_id);
91 if (!guest_web_contents) 91 if (!guest_web_contents)
92 return NULL; 92 return NULL;
93 93
94 return GuestViewBase::FromWebContents(guest_web_contents); 94 return GuestViewBase::FromWebContents(guest_web_contents);
95 } 95 }
96 96
97 // static 97 // static
98 bool GuestViewBase::GetGuestPartitionConfigForSite( 98 bool GuestViewBase::GetGuestPartitionConfigForSite(
99 const GURL& site, 99 const GURL& site,
100 std::string* partition_domain, 100 std::string* partition_domain,
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 void GuestViewBase::SendQueuedEvents() { 221 void GuestViewBase::SendQueuedEvents() {
222 if (!attached()) 222 if (!attached())
223 return; 223 return;
224 224
225 while (!pending_events_.empty()) { 225 while (!pending_events_.empty()) {
226 linked_ptr<Event> event_ptr = pending_events_.front(); 226 linked_ptr<Event> event_ptr = pending_events_.front();
227 pending_events_.pop_front(); 227 pending_events_.pop_front();
228 DispatchEvent(event_ptr.release()); 228 DispatchEvent(event_ptr.release());
229 } 229 }
230 } 230 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698