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

Unified Diff: webkit/plugins/ppapi/plugin_module.h

Issue 6628019: Ensure that PP_Instance values are unique within a plugin process in addition... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 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/ppb_file_ref_proxy.cc ('k') | webkit/plugins/ppapi/plugin_module.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/plugin_module.h
===================================================================
--- webkit/plugins/ppapi/plugin_module.h (revision 77663)
+++ webkit/plugins/ppapi/plugin_module.h (working copy)
@@ -15,6 +15,8 @@
#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
#include "base/weak_ptr.h"
+#include "ppapi/c/pp_bool.h"
+#include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_module.h"
#include "ppapi/c/ppb.h"
#include "webkit/plugins/ppapi/plugin_delegate.h"
@@ -126,6 +128,18 @@
// release relevant resources and update all affected instances.
void PluginCrashed();
+ // Reserves the given instance is unique within the plugin, checking for
+ // collisions. See PPB_Proxy_Private for more information.
+ //
+ // The setter will set the callback which is set up when the proxy
+ // initializes. The Reserve function will call the previously set callback if
+ // it exists to validate the ID. If the callback has not been set (such as
+ // for in-process plugins), the Reserve function will assume that the ID is
+ // usable and will return true.
+ void SetReserveInstanceIDCallback(
+ PP_Bool (*reserve)(PP_Module, PP_Instance));
+ bool ReserveInstanceID(PP_Instance instance);
+
private:
// Calls the InitializeModule entrypoint. The entrypoint must have been
// set and the plugin must not be out of process (we don't maintain
@@ -167,6 +181,8 @@
typedef std::set<PluginInstance*> PluginInstanceSet;
PluginInstanceSet instances_;
+ PP_Bool (*reserve_instance_id_)(PP_Module, PP_Instance);
+
DISALLOW_COPY_AND_ASSIGN(PluginModule);
};
« no previous file with comments | « ppapi/proxy/ppb_file_ref_proxy.cc ('k') | webkit/plugins/ppapi/plugin_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698