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

Unified Diff: content/renderer/pepper/host_array_buffer_var.cc

Issue 1154613006: Update pepper to not assume that SharedMemoryHandle is an int. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another nits pass. Created 5 years, 7 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
Index: content/renderer/pepper/host_array_buffer_var.cc
diff --git a/content/renderer/pepper/host_array_buffer_var.cc b/content/renderer/pepper/host_array_buffer_var.cc
index ad9e5e6bd43284f6e811fc5db1ec132aa8ca3601..67f5f81f0edcbcadeeb89a91098b508937a42a78 100644
--- a/content/renderer/pepper/host_array_buffer_var.cc
+++ b/content/renderer/pepper/host_array_buffer_var.cc
@@ -15,6 +15,7 @@
#include "content/common/sandbox_util.h"
#include "content/renderer/pepper/host_globals.h"
#include "content/renderer/pepper/plugin_module.h"
+#include "content/renderer/pepper/renderer_ppapi_host_impl.h"
#include "content/renderer/render_thread_impl.h"
#include "ppapi/c/pp_instance.h"
@@ -74,16 +75,10 @@ bool HostArrayBufferVar::CopyToNewShmem(
// its handle on us.
HostGlobals* hg = HostGlobals::Get();
PluginModule* pm = hg->GetModule(hg->GetModuleForInstance(instance));
- base::ProcessId p = pm->GetPeerProcessId();
- if (p == base::kNullProcessId) {
- // In-process, clone for ourselves.
- p = base::GetCurrentProcId();
- }
-
- base::PlatformFile platform_file =
- PlatformFileFromSharedMemoryHandle(shm->handle());
- *plugin_shm_handle = BrokerGetFileHandleForProcess(platform_file, p, false);
+ *plugin_shm_handle =
+ pm->renderer_ppapi_host()->ShareSharedMemoryHandleWithRemote(
+ shm->handle());
*host_shm_handle_id = -1;
return true;
}

Powered by Google App Engine
This is Rietveld 408576698