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

Unified Diff: chrome/browser/guest_view/guest_view_manager.h

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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/guest_view/guest_view_manager.h
diff --git a/chrome/browser/guest_view/guest_view_manager.h b/chrome/browser/guest_view/guest_view_manager.h
index 0c7382795ef373cad9ac0f24d4c37586d4308759..b26ae9c89e78b60b2ab16e5fad606daf5c13e969 100644
--- a/chrome/browser/guest_view/guest_view_manager.h
+++ b/chrome/browser/guest_view/guest_view_manager.h
@@ -29,19 +29,24 @@ class GuestViewManager : public content::BrowserPluginGuestManagerDelegate,
static GuestViewManager* FromBrowserContext(content::BrowserContext* context);
+ // Returns the guest WebContents associated with the given |guest_instance_id|
+ // if the provided |embedder_render_process_id| is allowed to access it.
+ // If the embedder is not allowed access, the embedder will be killed, and
+ // this method will return NULL. If no WebContents exists with the given
+ // instance ID, then NULL will also be returned.
+ content::WebContents* GetGuestByInstanceIDSafely(
+ int guest_instance_id,
+ int embedder_render_process_id);
+
// BrowserPluginGuestManagerDelegate implementation.
virtual int GetNextInstanceID() OVERRIDE;
virtual void AddGuest(int guest_instance_id,
content::WebContents* guest_web_contents) OVERRIDE;
virtual void RemoveGuest(int guest_instance_id) OVERRIDE;
- virtual content::WebContents* GetGuestByInstanceID(
+ virtual void MaybeGetGuestByInstanceIDOrKill(
int guest_instance_id,
- int embedder_render_process_id) OVERRIDE;
- virtual bool CanEmbedderAccessInstanceIDMaybeKill(
int embedder_render_process_id,
- int guest_instance_id) OVERRIDE;
- virtual bool CanEmbedderAccessInstanceID(int embedder_render_process_id,
- int guest_instance_id) OVERRIDE;
+ const GuestByInstanceIDCallback& callback) OVERRIDE;
virtual content::SiteInstance* GetGuestSiteInstance(
const GURL& guest_site) OVERRIDE;
virtual bool ForEachGuest(content::WebContents* embedder_web_contents,
@@ -52,6 +57,17 @@ class GuestViewManager : public content::BrowserPluginGuestManagerDelegate,
void AddRenderProcessHostID(int render_process_host_id);
+ content::WebContents* GetGuestByInstanceID(
+ int guest_instance_id,
+ int embedder_render_process_id);
+
+ bool CanEmbedderAccessInstanceIDMaybeKill(
+ int embedder_render_process_id,
+ int guest_instance_id);
+
+ bool CanEmbedderAccessInstanceID(int embedder_render_process_id,
+ int guest_instance_id);
+
static bool CanEmbedderAccessGuest(int embedder_render_process_id,
GuestViewBase* guest);

Powered by Google App Engine
This is Rietveld 408576698