summaryrefslogtreecommitdiffstats
path: root/content/public/browser/browser_plugin_guest_manager.h
diff options
context:
space:
mode:
authorfsamuel@chromium.org <fsamuel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-11 14:21:28 +0000
committerfsamuel@chromium.org <fsamuel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-11 14:21:28 +0000
commit139355fc088b23f85a290471a7698861d0e804c5 (patch)
tree5b8302a2e1aca70cea7aafc1f2c61886021edb3b /content/public/browser/browser_plugin_guest_manager.h
parent7c6f155e075991e2e94d1682c5d0e9b341a8831e (diff)
downloadchromium_src-139355fc088b23f85a290471a7698861d0e804c5.zip
chromium_src-139355fc088b23f85a290471a7698861d0e804c5.tar.gz
chromium_src-139355fc088b23f85a290471a7698861d0e804c5.tar.bz2
Rename BrowserPluginGuestManagerDelegate to BrowserPluginGuestManager
BUG=364141, 330264 TBR=jamescook@chromium.org, michaelbai@chromium.org Review URL: https://codereview.chromium.org/261363002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269705 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/public/browser/browser_plugin_guest_manager.h')
-rw-r--r--content/public/browser/browser_plugin_guest_manager.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/content/public/browser/browser_plugin_guest_manager.h b/content/public/browser/browser_plugin_guest_manager.h
new file mode 100644
index 0000000..6a54d4b
--- /dev/null
+++ b/content/public/browser/browser_plugin_guest_manager.h
@@ -0,0 +1,65 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_MANAGER_H_
+#define CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_MANAGER_H_
+
+#include <string>
+
+#include "base/callback.h"
+#include "content/common/content_export.h"
+
+class GURL;
+
+namespace base {
+class DictionaryValue;
+} // namespace base
+
+namespace content {
+
+class SiteInstance;
+class WebContents;
+
+// A BrowserPluginGuestManager offloads guest management and routing
+// operations outside of the content layer.
+class CONTENT_EXPORT BrowserPluginGuestManager {
+ public:
+ virtual ~BrowserPluginGuestManager() {}
+
+ // Requests the allocation of a new guest WebContents.
+ virtual content::WebContents* CreateGuest(
+ content::SiteInstance* embedder_site_instance,
+ int instance_id,
+ const std::string& storage_partition_id,
+ bool persist_storage,
+ scoped_ptr<base::DictionaryValue> extra_params);
+
+ // Return a new instance ID.
+ // TODO(fsamuel): Remove this. Once the instance ID concept is moved
+ // entirely out of content and into chrome, this API will be unnecessary.
+ virtual int GetNextInstanceID();
+
+ typedef base::Callback<void(WebContents*)> GuestByInstanceIDCallback;
+ // Requests a guest WebContents associated with the provided
+ // |guest_instance_id|. If a guest associated with the provided ID
+ // does not exist, then the |callback| will be called with a NULL
+ // WebContents. If the provided |embedder_render_process_id| does
+ // not own the requested guest, then the embedder will be killed,
+ // and the |callback| will not be called.
+ virtual void MaybeGetGuestByInstanceIDOrKill(
+ int guest_instance_id,
+ int embedder_render_process_id,
+ const GuestByInstanceIDCallback& callback) {}
+
+ // Iterates over all WebContents belonging to a given |embedder_web_contents|,
+ // calling |callback| for each. If one of the callbacks returns true, then
+ // the iteration exits early.
+ typedef base::Callback<bool(WebContents*)> GuestCallback;
+ virtual bool ForEachGuest(WebContents* embedder_web_contents,
+ const GuestCallback& callback);
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_MANAGER_H_