From 30e1cb75b8fa46b67cfc7faa146eacdca5e90241 Mon Sep 17 00:00:00 2001 From: "teravest@chromium.org" Date: Tue, 19 Mar 2013 20:42:33 +0000 Subject: Pepper: Use shared memory for ArrayBufferVar. This change improves performance for sending ArrayBufferVars between the plugin and the host. It copies the data from the var into a shared memory region and sends the shared memory handle over IPC. This required defining a new message for plugins to request the host to create shared memory. BUG= Review URL: https://chromiumcodereview.appspot.com/11827059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189089 0039d316-1c4b-4281-b951-d872f2087c98 --- ppapi/proxy/plugin_var_tracker.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'ppapi/proxy/plugin_var_tracker.cc') diff --git a/ppapi/proxy/plugin_var_tracker.cc b/ppapi/proxy/plugin_var_tracker.cc index 384eb3ec..cff8fa1 100644 --- a/ppapi/proxy/plugin_var_tracker.cc +++ b/ppapi/proxy/plugin_var_tracker.cc @@ -194,6 +194,12 @@ ArrayBufferVar* PluginVarTracker::CreateArrayBuffer(uint32 size_in_bytes) { return new PluginArrayBufferVar(size_in_bytes); } +ArrayBufferVar* PluginVarTracker::CreateShmArrayBuffer( + uint32 size_in_bytes, + base::SharedMemoryHandle handle) { + return new PluginArrayBufferVar(size_in_bytes, handle); +} + void PluginVarTracker::PluginImplementedObjectCreated( PP_Instance instance, const PP_Var& created_var, @@ -369,5 +375,21 @@ scoped_refptr PluginVarTracker::FindOrMakePluginVarFromHostVar( return scoped_refptr(ret->second.var->AsProxyObjectVar()); } +int PluginVarTracker::TrackSharedMemoryHandle(PP_Instance instance, + base::SharedMemoryHandle handle, + uint32 size_in_bytes) { + NOTREACHED(); + return -1; +} + +bool PluginVarTracker::StopTrackingSharedMemoryHandle( + int id, + PP_Instance instance, + base::SharedMemoryHandle* handle, + uint32* size_in_bytes) { + NOTREACHED(); + return false; +} + } // namesace proxy } // namespace ppapi -- cgit v1.1