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

Unified Diff: ppapi/host/ppapi_host.h

Issue 11414147: Add ability to create pending resource hosts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 | « no previous file | ppapi/host/ppapi_host.cc » ('j') | ppapi/proxy/plugin_resource.h » ('J')
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 7210b81da10369851075f6e0781d68c2ca85af47..fb4ea615a7d2065d1e3eb41dab2bad25f8b12c6b 100644
--- a/ppapi/host/ppapi_host.h
+++ b/ppapi/host/ppapi_host.h
@@ -61,6 +61,11 @@ class PPAPI_HOST_EXPORT PpapiHost : public IPC::Sender, public IPC::Listener {
// Sends the given unsolicited reply message to the plugin.
void SendUnsolicitedReply(PP_Resource resource, const IPC::Message& msg);
+ // Adds the given host resource as a pending one (with no corresponding
+ // PluginResource object and no PP_Resource ID yet). The pending resource ID
+ // is returned. See PpapiHostMsg_AttachToPendingHost.
+ int AddPendingResourceHost(scoped_ptr<ResourceHost> resource_host);
+
// Adds the given host factory filter to the host. The PpapiHost will take
// ownership of the pointer.
void AddHostFactoryFilter(scoped_ptr<HostFactory> filter);
@@ -90,6 +95,7 @@ class PPAPI_HOST_EXPORT PpapiHost : public IPC::Sender, public IPC::Listener {
void OnHostMsgResourceCreated(const proxy::ResourceMessageCallParams& param,
PP_Instance instance,
const IPC::Message& nested_msg);
+ void OnHostMsgAttachToPendingHost(PP_Resource rseource, int pending_host_id);
raymes 2012/12/03 15:55:18 rseource->resource
void OnHostMsgResourceDestroyed(PP_Resource resource);
// Non-owning pointer.
@@ -112,6 +118,13 @@ class PPAPI_HOST_EXPORT PpapiHost : public IPC::Sender, public IPC::Listener {
typedef std::map<PP_Resource, linked_ptr<ResourceHost> > ResourceMap;
ResourceMap resources_;
+ // Resources that have been created in the host and have not yet had the
+ // corresponding PluginResource associated with them.
+ // See PpapiHostMsg_AttachToPendingHost.
+ typedef std::map<int, linked_ptr<ResourceHost> > PendingHostResourceMap;
+ PendingHostResourceMap pending_resource_hosts_;
+ int next_pending_resource_host_id_;
+
DISALLOW_COPY_AND_ASSIGN(PpapiHost);
};
« no previous file with comments | « no previous file | ppapi/host/ppapi_host.cc » ('j') | ppapi/proxy/plugin_resource.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698