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

Unified Diff: content/browser/browser_plugin/browser_plugin_guest_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: content/browser/browser_plugin/browser_plugin_guest_manager.h
diff --git a/content/browser/browser_plugin/browser_plugin_guest_manager.h b/content/browser/browser_plugin/browser_plugin_guest_manager.h
index 3c157fe3c875258338ea7e08b364a9052e673ed1..31210dd89e7b1406bd5a8288170cddff1d2c4d8f 100644
--- a/content/browser/browser_plugin/browser_plugin_guest_manager.h
+++ b/content/browser/browser_plugin/browser_plugin_guest_manager.h
@@ -71,13 +71,6 @@ class CONTENT_EXPORT BrowserPluginGuestManager :
const BrowserPluginHostMsg_Attach_Params& params,
scoped_ptr<base::DictionaryValue> extra_params);
- // Returns a BrowserPluginGuest given an |instance_id|. Returns NULL if the
- // guest wasn't found. If the embedder is not permitted to access the given
- // |instance_id|, the embedder is killed, and NULL is returned.
- BrowserPluginGuest* GetGuestByInstanceID(
- int instance_id,
- int embedder_render_process_id) const;
-
// Adds a new |guest_web_contents| to the embedder (overridable in test).
virtual void AddGuest(int instance_id, WebContents* guest_web_contents);
@@ -85,10 +78,11 @@ class CONTENT_EXPORT BrowserPluginGuestManager :
// BrowserPluginGuestManager.
void RemoveGuest(int instance_id);
- // Returns whether the specified embedder is permitted to access the given
- // |instance_id|, and kills the embedder if not.
- bool CanEmbedderAccessInstanceIDMaybeKill(int embedder_render_process_id,
- int instance_id) const;
+ typedef base::Callback<void(BrowserPluginGuest*)> GuestByInstanceIDCallback;
+ void MaybeGetGuestByInstanceIDOrKill(
+ int instance_id,
+ int embedder_render_process_id,
+ const GuestByInstanceIDCallback& callback) const;
typedef base::Callback<bool(BrowserPluginGuest*)> GuestCallback;
bool ForEachGuest(WebContents* embedder_web_contents,
@@ -111,6 +105,11 @@ class CONTENT_EXPORT BrowserPluginGuestManager :
// The BrowserContext in which this manager this stored.
BrowserContext* context_;
+ // Contains guests' WebContents, mapping from their instance ids.
+ typedef std::map<int, WebContents*> GuestInstanceMap;
+ GuestInstanceMap guest_web_contents_by_instance_id_;
+ int next_instance_id_;
+
DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuestManager);
};

Powered by Google App Engine
This is Rietveld 408576698