From a1faef23466e8786b2733c0f24902c9cc5363bfb Mon Sep 17 00:00:00 2001 From: erikchen Date: Mon, 22 Feb 2016 12:28:12 -0800 Subject: Remove the method BrokerDuplicateSharedMemoryHandle. Now that Chrome IPC brokers SharedMemoryHandles, there is no need for consumers of Chrome IPC to manually duplicate handles into the destination process. BUG=493414 Review URL: https://codereview.chromium.org/1674123002 Cr-Commit-Position: refs/heads/master@{#376797} --- ppapi/proxy/ppb_image_data_proxy.cc | 19 +------------------ ppapi/proxy/ppb_image_data_proxy.h | 1 - ppapi/proxy/serialized_structs.h | 4 ---- 3 files changed, 1 insertion(+), 23 deletions(-) (limited to 'ppapi') diff --git a/ppapi/proxy/ppb_image_data_proxy.cc b/ppapi/proxy/ppb_image_data_proxy.cc index 4142f65..5e4ebe1 100644 --- a/ppapi/proxy/ppb_image_data_proxy.cc +++ b/ppapi/proxy/ppb_image_data_proxy.cc @@ -376,8 +376,7 @@ PlatformImageData::PlatformImageData(const HostResource& resource, ImageHandle handle) : ImageData(resource, PPB_ImageData_Shared::PLATFORM, desc) { #if defined(OS_WIN) - transport_dib_.reset(TransportDIB::CreateWithHandle( - base::SharedMemoryHandle(handle, base::GetCurrentProcId()))); + transport_dib_.reset(TransportDIB::CreateWithHandle(handle)); #else transport_dib_.reset(TransportDIB::Map(handle)); #endif // defined(OS_WIN) @@ -420,19 +419,7 @@ SkCanvas* PlatformImageData::GetCanvas() { // static ImageHandle PlatformImageData::NullHandle() { -#if defined(OS_WIN) - return NULL; -#else return ImageHandle(); -#endif -} - -ImageHandle PlatformImageData::HandleFromInt(int32_t i) { -#if defined(OS_WIN) - return reinterpret_cast(i); -#else - return ImageHandle(i, false); -#endif } #endif // !defined(OS_NACL) @@ -633,11 +620,7 @@ void PPB_ImageData_Proxy::OnHostMsgCreatePlatform( desc, &image_handle, &byte_count); result->SetHostResource(instance, resource); if (resource) { -#if defined(OS_WIN) - *result_image_handle = image_handle.GetHandle(); -#else *result_image_handle = image_handle; -#endif } else { *result_image_handle = PlatformImageData::NullHandle(); } diff --git a/ppapi/proxy/ppb_image_data_proxy.h b/ppapi/proxy/ppb_image_data_proxy.h index 82abb4a..46fb9af 100644 --- a/ppapi/proxy/ppb_image_data_proxy.h +++ b/ppapi/proxy/ppb_image_data_proxy.h @@ -98,7 +98,6 @@ class PPAPI_PROXY_EXPORT PlatformImageData : public ImageData { SkCanvas* GetCanvas() override; static ImageHandle NullHandle(); - static ImageHandle HandleFromInt(int32_t i); private: scoped_ptr transport_dib_; diff --git a/ppapi/proxy/serialized_structs.h b/ppapi/proxy/serialized_structs.h index 3820056..bec991f 100644 --- a/ppapi/proxy/serialized_structs.h +++ b/ppapi/proxy/serialized_structs.h @@ -134,11 +134,7 @@ struct PPB_AudioEncodeParameters { }; // TODO(raymes): Make ImageHandle compatible with SerializedHandle. -#if defined(OS_WIN) -typedef HANDLE ImageHandle; -#else typedef base::SharedMemoryHandle ImageHandle; -#endif } // namespace proxy } // namespace ppapi -- cgit v1.1