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

Unified Diff: ppapi/host/resource_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
Index: ppapi/host/resource_host.h
diff --git a/ppapi/host/resource_host.h b/ppapi/host/resource_host.h
index 763da2c185578b854b7bf014a094c991258d2de8..097611851597e8786ce6102c08c0f18468e3dcf3 100644
--- a/ppapi/host/resource_host.h
+++ b/ppapi/host/resource_host.h
@@ -43,6 +43,14 @@ class PPAPI_HOST_EXPORT ResourceHost : public ResourceMessageHandler {
virtual bool HandleMessage(const IPC::Message& msg,
HostMessageContext* context) OVERRIDE;
+ // Sets the PP_Resource ID when the plugin attaches to a pending resource
+ // host. This will notify subclasses by calling
+ // DidConnectPendingHostToResource.
+ //
+ // The current PP_Resource for all pending hosts should be 0. See
+ // PpapiHostMsg_AttachToPendingHost.
+ void SetPPResourceForPendingHost(PP_Resource pp_resource);
+
virtual void SendReply(const ReplyMessageContext& context,
const IPC::Message& msg) OVERRIDE;
@@ -55,6 +63,13 @@ class PPAPI_HOST_EXPORT ResourceHost : public ResourceMessageHandler {
// ResourceHosts to easily handle messages on other threads.
void AddFilter(scoped_refptr<ResourceMessageFilter> filter);
+ // Called when this resource host is pending and the corresponding plugin has
+ // just connected to it. The host resource subclass can implement this
+ // function if it wants to do processing (typically sending queued data).
+ //
+ // The PP_Resource will be valid for this call but not before.
+ virtual void DidConnectPendingHostToResource() {}
+
private:
// The host that owns this object.
PpapiHost* host_;

Powered by Google App Engine
This is Rietveld 408576698