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

Unified Diff: ppapi/host/ppapi_host.h

Issue 10909138: Convert the async device ID getter to a chrome resource host (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 3 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
« no previous file with comments | « ppapi/host/host_message_context.cc ('k') | ppapi/host/ppapi_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/host/ppapi_host.h
diff --git a/ppapi/host/ppapi_host.h b/ppapi/host/ppapi_host.h
index 3f3605c529875f70837cf1ce23aa2effb7cf60bd..748d47a531884c2497b6e985a18a425ff2e9e634 100644
--- a/ppapi/host/ppapi_host.h
+++ b/ppapi/host/ppapi_host.h
@@ -37,12 +37,11 @@ class ResourceHost;
// corresponding replies.
class PPAPI_HOST_EXPORT PpapiHost : public IPC::Sender, public IPC::Listener {
public:
- // The sender is the channel to the plugin for outgoing messages. The factory
- // will be used to receive resource creation messages from the plugin. Both
- // pointers are owned by the caller and must outlive this class.
- PpapiHost(IPC::Sender* sender,
- HostFactory* host_factory,
- const PpapiPermissions& perms);
+ // The sender is the channel to the plugin for outgoing messages.
+ // Normally the creator will add filters for resource creation messages
+ // (AddHostFactoryFilter) and instance messages (AddInstanceMessageFilter)
+ // after construction.
+ PpapiHost(IPC::Sender* sender, const PpapiPermissions& perms);
virtual ~PpapiHost();
const PpapiPermissions& permissions() const { return permissions_; }
@@ -57,6 +56,10 @@ class PPAPI_HOST_EXPORT PpapiHost : public IPC::Sender, public IPC::Listener {
void SendReply(const proxy::ResourceMessageReplyParams& params,
const IPC::Message& msg);
+ // Adds the given host factory filter to the host. The PpapiHost will take
+ // ownership of the pointer.
+ void AddHostFactoryFilter(scoped_ptr<HostFactory> filter);
+
// Adds the given message filter to the host. The PpapiHost will take
// ownership of the pointer.
void AddInstanceMessageFilter(scoped_ptr<InstanceMessageFilter> filter);
@@ -78,11 +81,14 @@ class PPAPI_HOST_EXPORT PpapiHost : public IPC::Sender, public IPC::Listener {
// Non-owning pointer.
IPC::Sender* sender_;
- // Non-owning pointer.
- HostFactory* host_factory_;
-
PpapiPermissions permissions_;
+ // Filters for resource creation messages. Note that since we don't support
+ // deleting these dynamically we don't need to worry about modifications
+ // during iteration. If we add that capability, this should be replaced with
+ // an ObserverList.
+ ScopedVector<HostFactory> host_factory_filters_;
+
// Filters for instance messages. Note that since we don't support deleting
// these dynamically we don't need to worry about modifications during
// iteration. If we add that capability, this should be replaced with an
« no previous file with comments | « ppapi/host/host_message_context.cc ('k') | ppapi/host/ppapi_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698