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

Unified Diff: ppapi/proxy/plugin_resource.h

Issue 6334016: Refactor PPAPI proxy resource handling to maintain which host they came from,... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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/proxy/mock_resource.cc ('k') | ppapi/proxy/plugin_resource.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/plugin_resource.h
===================================================================
--- ppapi/proxy/plugin_resource.h (revision 72840)
+++ ppapi/proxy/plugin_resource.h (working copy)
@@ -7,6 +7,7 @@
#include "base/basictypes.h"
#include "ppapi/c/pp_instance.h"
+#include "ppapi/proxy/host_resource.h"
#include "ppapi/proxy/plugin_dispatcher.h"
#include "ppapi/proxy/plugin_resource_tracker.h"
@@ -18,6 +19,7 @@
F(Font) \
F(Graphics2D) \
F(ImageData) \
+ F(MockResource) \
F(PrivateFontFile) \
F(URLLoader) \
F(URLRequestInfo)\
@@ -33,7 +35,7 @@
class PluginResource {
public:
- PluginResource(PP_Instance instance);
+ PluginResource(const HostResource& resource);
virtual ~PluginResource();
// Returns NULL if the resource is invalid or is a different type.
@@ -45,8 +47,13 @@
template <typename T> T* Cast() { return NULL; }
- PP_Instance instance() const { return instance_; }
+ PP_Instance instance() const { return host_resource_.instance(); }
+ // Returns the host resource ID for sending to the host process.
+ const HostResource& host_resource() const {
+ return host_resource_;
+ }
+
private:
// Type-specific getters for individual resource types. These will return
// NULL if the resource does not match the specified type. Used by the Cast()
@@ -56,8 +63,11 @@
FOR_ALL_PLUGIN_RESOURCES(DEFINE_TYPE_GETTER)
#undef DEFINE_TYPE_GETTER
- // Instance this resource is associated with.
- PP_Instance instance_;
+ // The resource ID in the host that this object corresponds to. Inside the
+ // plugin we'll remap the resource IDs so we can have many host processes
+ // each independently generating resources (which may conflict) but the IDs
+ // in the plugin will all be unique.
+ HostResource host_resource_;
DISALLOW_COPY_AND_ASSIGN(PluginResource);
};
« no previous file with comments | « ppapi/proxy/mock_resource.cc ('k') | ppapi/proxy/plugin_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698