summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy/host_resource.h
diff options
context:
space:
mode:
Diffstat (limited to 'ppapi/proxy/host_resource.h')
-rw-r--r--ppapi/proxy/host_resource.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/ppapi/proxy/host_resource.h b/ppapi/proxy/host_resource.h
index badd2fd..fe1abb2 100644
--- a/ppapi/proxy/host_resource.h
+++ b/ppapi/proxy/host_resource.h
@@ -27,6 +27,16 @@ class HostResource {
return !host_resource_;
}
+ // Some resources are plugin-side only and don't have a corresponding
+ // resource in the host. Yet these resources still need an instance to be
+ // associated with. This function creates a HostResource with the given
+ // instances and a 0 host resource ID for these cases.
+ static HostResource MakeInstanceOnly(PP_Instance instance) {
+ HostResource resource;
+ resource.SetHostResource(instance, 0);
+ return resource;
+ }
+
// Sets and retrieves the internal PP_Resource which is valid for the host
// (a.k.a. renderer, as opposed to the plugin) process.
//