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(); |