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

Unified Diff: webkit/plugins/ppapi/ppb_buffer_impl.cc

Issue 7108051: Implement out-of-process proxy for PPB_Buffer_Dev. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: exclude out-of-process testing for OS_MACOSX, where apparently sandboxing dies at startup. Created 9 years, 6 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 | « webkit/plugins/ppapi/ppb_buffer_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_buffer_impl.cc
diff --git a/webkit/plugins/ppapi/ppb_buffer_impl.cc b/webkit/plugins/ppapi/ppb_buffer_impl.cc
index 39d31915c038f442d936917696c2f34d395e4ac8..5c248d6f4463dfd27e66255f417751d2d8c0bd75 100644
--- a/webkit/plugins/ppapi/ppb_buffer_impl.cc
+++ b/webkit/plugins/ppapi/ppb_buffer_impl.cc
@@ -15,6 +15,7 @@
#include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
using ::ppapi::thunk::PPB_Buffer_API;
+using ::ppapi::thunk::PPB_BufferTrusted_API;
namespace webkit {
namespace ppapi {
@@ -45,6 +46,10 @@ PPB_Buffer_API* PPB_Buffer_Impl::AsPPB_Buffer_API() {
return this;
}
+PPB_BufferTrusted_API* PPB_Buffer_Impl::AsPPB_BufferTrusted_API() {
+ return this;
+}
+
bool PPB_Buffer_Impl::Init(uint32_t size) {
if (size == 0 || !instance())
return false;
@@ -75,6 +80,18 @@ void PPB_Buffer_Impl::Unmap() {
shared_memory_->Unmap();
}
+int32_t PPB_Buffer_Impl::GetSharedMemory(int* shm_handle) {
+#if defined(OS_POSIX)
+ *shm_handle = shared_memory_->handle().fd;
+#elif defined(OS_WIN)
+ *shm_handle = reinterpret_cast<int>(
+ shared_memory_->handle());
+#else
+#error "Platform not supported."
+#endif
+ return PP_OK;
+}
+
BufferAutoMapper::BufferAutoMapper(PPB_Buffer_API* api) : api_(api) {
needs_unmap_ = !PP_ToBool(api->IsMapped());
data_ = api->Map();
« no previous file with comments | « webkit/plugins/ppapi/ppb_buffer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698