Skip to content

Commit

Permalink
Remove unused code for sharing shared memory handles with plugins
Browse files Browse the repository at this point in the history
This CL removes code that shares base::SharedMemoryHandle with remote.
This code is no longer used because base::SharedMemoryHandle is
deprecated and replaced with base::*SharedMemoryRegion.

Bug: 795291
Change-Id: I5974bd77b6e40bee662dc2fb4092b7a61f725afb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1916827
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Auto-Submit: Alex Ilin <alexilin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715867}
  • Loading branch information
Alex Ilin authored and Commit Bot committed Nov 15, 2019
1 parent 0d7d6ad commit 778f23a
Show file tree
Hide file tree
Showing 16 changed files with 0 additions and 92 deletions.
4 changes: 0 additions & 4 deletions components/pdf/renderer/pdf_accessibility_tree_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ class FakeRendererPpapiHost : public content::RendererPpapiHost {
bool should_close_source) override {
return IPC::PlatformFileForTransit();
}
base::SharedMemoryHandle ShareSharedMemoryHandleWithRemote(
const base::SharedMemoryHandle& handle) override {
return base::SharedMemoryHandle();
}
base::UnsafeSharedMemoryRegion ShareUnsafeSharedMemoryRegionWithRemote(
const base::UnsafeSharedMemoryRegion& region) override {
return base::UnsafeSharedMemoryRegion();
Expand Down
7 changes: 0 additions & 7 deletions content/ppapi_plugin/ppapi_thread.cc
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,6 @@ IPC::PlatformFileForTransit PpapiThread::ShareHandleWithRemote(
return IPC::GetPlatformFileForTransit(handle, should_close_source);
}

base::SharedMemoryHandle PpapiThread::ShareSharedMemoryHandleWithRemote(
const base::SharedMemoryHandle& handle,
base::ProcessId remote_pid) {
DCHECK(remote_pid != base::kNullProcessId);
return base::SharedMemory::DuplicateHandle(handle);
}

base::UnsafeSharedMemoryRegion
PpapiThread::ShareUnsafeSharedMemoryRegionWithRemote(
const base::UnsafeSharedMemoryRegion& region,
Expand Down
3 changes: 0 additions & 3 deletions content/ppapi_plugin/ppapi_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,6 @@ class PpapiThread : public ChildThreadImpl,
base::PlatformFile handle,
base::ProcessId peer_pid,
bool should_close_source) override;
base::SharedMemoryHandle ShareSharedMemoryHandleWithRemote(
const base::SharedMemoryHandle& handle,
base::ProcessId remote_pid) override;
base::UnsafeSharedMemoryRegion ShareUnsafeSharedMemoryRegionWithRemote(
const base::UnsafeSharedMemoryRegion& region,
base::ProcessId remote_pid) override;
Expand Down
3 changes: 0 additions & 3 deletions content/public/renderer/renderer_ppapi_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "base/files/file.h"
#include "base/memory/read_only_shared_memory_region.h"
#include "base/memory/ref_counted.h"
#include "base/memory/shared_memory.h"
#include "base/memory/unsafe_shared_memory_region.h"
#include "base/process/process.h"
#include "content/common/content_export.h"
Expand Down Expand Up @@ -116,8 +115,6 @@ class RendererPpapiHost {
// returns a handle that should be sent in exactly one IPC message. Upon
// receipt, the remote side then owns that handle. Note: if sending the
// message fails, the returned handle is properly closed by the IPC system.
virtual base::SharedMemoryHandle ShareSharedMemoryHandleWithRemote(
const base::SharedMemoryHandle& handle) = 0;
virtual base::UnsafeSharedMemoryRegion
ShareUnsafeSharedMemoryRegionWithRemote(
const base::UnsafeSharedMemoryRegion& region) = 0;
Expand Down
7 changes: 0 additions & 7 deletions content/renderer/pepper/mock_renderer_ppapi_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,6 @@ IPC::PlatformFileForTransit MockRendererPpapiHost::ShareHandleWithRemote(
return IPC::InvalidPlatformFileForTransit();
}

base::SharedMemoryHandle
MockRendererPpapiHost::ShareSharedMemoryHandleWithRemote(
const base::SharedMemoryHandle& handle) {
NOTIMPLEMENTED();
return base::SharedMemoryHandle();
}

base::UnsafeSharedMemoryRegion
MockRendererPpapiHost::ShareUnsafeSharedMemoryRegionWithRemote(
const base::UnsafeSharedMemoryRegion& region) {
Expand Down
2 changes: 0 additions & 2 deletions content/renderer/pepper/mock_renderer_ppapi_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ class MockRendererPpapiHost : public RendererPpapiHost {
IPC::PlatformFileForTransit ShareHandleWithRemote(
base::PlatformFile handle,
bool should_close_source) override;
base::SharedMemoryHandle ShareSharedMemoryHandleWithRemote(
const base::SharedMemoryHandle& handle) override;
base::UnsafeSharedMemoryRegion ShareUnsafeSharedMemoryRegionWithRemote(
const base::UnsafeSharedMemoryRegion& region) override;
base::ReadOnlySharedMemoryRegion ShareReadOnlySharedMemoryRegionWithRemote(
Expand Down
7 changes: 0 additions & 7 deletions content/renderer/pepper/pepper_proxy_channel_delegate_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@ PepperProxyChannelDelegateImpl::ShareHandleWithRemote(
return IPC::GetPlatformFileForTransit(handle, should_close_source);
}

base::SharedMemoryHandle
PepperProxyChannelDelegateImpl::ShareSharedMemoryHandleWithRemote(
const base::SharedMemoryHandle& handle,
base::ProcessId remote_pid) {
return base::SharedMemory::DuplicateHandle(handle);
}

base::UnsafeSharedMemoryRegion
PepperProxyChannelDelegateImpl::ShareUnsafeSharedMemoryRegionWithRemote(
const base::UnsafeSharedMemoryRegion& region,
Expand Down
3 changes: 0 additions & 3 deletions content/renderer/pepper/pepper_proxy_channel_delegate_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ class PepperProxyChannelDelegateImpl
base::PlatformFile handle,
base::ProcessId remote_pid,
bool should_close_source) override;
base::SharedMemoryHandle ShareSharedMemoryHandleWithRemote(
const base::SharedMemoryHandle& handle,
base::ProcessId remote_pid) override;
base::UnsafeSharedMemoryRegion ShareUnsafeSharedMemoryRegionWithRemote(
const base::UnsafeSharedMemoryRegion& region,
base::ProcessId remote_pid) override;
Expand Down
10 changes: 0 additions & 10 deletions content/renderer/pepper/renderer_ppapi_host_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -227,16 +227,6 @@ IPC::PlatformFileForTransit RendererPpapiHostImpl::ShareHandleWithRemote(
return dispatcher_->ShareHandleWithRemote(handle, should_close_source);
}

base::SharedMemoryHandle
RendererPpapiHostImpl::ShareSharedMemoryHandleWithRemote(
const base::SharedMemoryHandle& handle) {
if (!dispatcher_) {
DCHECK(is_running_in_process_);
return base::SharedMemory::DuplicateHandle(handle);
}
return dispatcher_->ShareSharedMemoryHandleWithRemote(handle);
}

base::UnsafeSharedMemoryRegion
RendererPpapiHostImpl::ShareUnsafeSharedMemoryRegionWithRemote(
const base::UnsafeSharedMemoryRegion& region) {
Expand Down
2 changes: 0 additions & 2 deletions content/renderer/pepper/renderer_ppapi_host_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ class RendererPpapiHostImpl : public RendererPpapiHost {
IPC::PlatformFileForTransit ShareHandleWithRemote(
base::PlatformFile handle,
bool should_close_source) override;
base::SharedMemoryHandle ShareSharedMemoryHandleWithRemote(
const base::SharedMemoryHandle& handle) override;
base::UnsafeSharedMemoryRegion ShareUnsafeSharedMemoryRegionWithRemote(
const base::UnsafeSharedMemoryRegion& region) override;
base::ReadOnlySharedMemoryRegion ShareReadOnlySharedMemoryRegionWithRemote(
Expand Down
6 changes: 0 additions & 6 deletions ppapi/nacl_irt/ppapi_dispatcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,6 @@ IPC::PlatformFileForTransit PpapiDispatcher::ShareHandleWithRemote(
return IPC::InvalidPlatformFileForTransit();
}

base::SharedMemoryHandle PpapiDispatcher::ShareSharedMemoryHandleWithRemote(
const base::SharedMemoryHandle& handle,
base::ProcessId remote_pid) {
return base::SharedMemoryHandle();
}

base::UnsafeSharedMemoryRegion
PpapiDispatcher::ShareUnsafeSharedMemoryRegionWithRemote(
const base::UnsafeSharedMemoryRegion& region,
Expand Down
3 changes: 0 additions & 3 deletions ppapi/nacl_irt/ppapi_dispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ class PpapiDispatcher : public proxy::PluginDispatcher::PluginDelegate,
base::PlatformFile handle,
base::ProcessId peer_pid,
bool should_close_source) override;
base::SharedMemoryHandle ShareSharedMemoryHandleWithRemote(
const base::SharedMemoryHandle& handle,
base::ProcessId remote_pid) override;
base::UnsafeSharedMemoryRegion ShareUnsafeSharedMemoryRegionWithRemote(
const base::UnsafeSharedMemoryRegion& region,
base::ProcessId remote_pid) override;
Expand Down
14 changes: 0 additions & 14 deletions ppapi/proxy/ppapi_proxy_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,6 @@ PluginProxyTestHarness::PluginDelegateMock::ShareHandleWithRemote(
should_close_source);
}

base::SharedMemoryHandle
PluginProxyTestHarness::PluginDelegateMock::ShareSharedMemoryHandleWithRemote(
const base::SharedMemoryHandle& handle,
base::ProcessId /* remote_pid */) {
return base::SharedMemory::DuplicateHandle(handle);
}

base::UnsafeSharedMemoryRegion PluginProxyTestHarness::PluginDelegateMock::
ShareUnsafeSharedMemoryRegionWithRemote(
const base::UnsafeSharedMemoryRegion& region,
Expand Down Expand Up @@ -506,13 +499,6 @@ HostProxyTestHarness::DelegateMock::ShareHandleWithRemote(
should_close_source);
}

base::SharedMemoryHandle
HostProxyTestHarness::DelegateMock::ShareSharedMemoryHandleWithRemote(
const base::SharedMemoryHandle& handle,
base::ProcessId /*remote_pid*/) {
return base::SharedMemory::DuplicateHandle(handle);
}

base::UnsafeSharedMemoryRegion
HostProxyTestHarness::DelegateMock::ShareUnsafeSharedMemoryRegionWithRemote(
const base::UnsafeSharedMemoryRegion& region,
Expand Down
6 changes: 0 additions & 6 deletions ppapi/proxy/ppapi_proxy_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,6 @@ class PluginProxyTestHarness : public ProxyTestHarnessBase {
base::PlatformFile handle,
base::ProcessId remote_pid,
bool should_close_source) override;
base::SharedMemoryHandle ShareSharedMemoryHandleWithRemote(
const base::SharedMemoryHandle& handle,
base::ProcessId remote_pid) override;
base::UnsafeSharedMemoryRegion ShareUnsafeSharedMemoryRegionWithRemote(
const base::UnsafeSharedMemoryRegion& region,
base::ProcessId remote_pid) override;
Expand Down Expand Up @@ -296,9 +293,6 @@ class HostProxyTestHarness : public ProxyTestHarnessBase {
base::PlatformFile handle,
base::ProcessId remote_pid,
bool should_close_source) override;
base::SharedMemoryHandle ShareSharedMemoryHandleWithRemote(
const base::SharedMemoryHandle& handle,
base::ProcessId remote_pid) override;
base::UnsafeSharedMemoryRegion ShareUnsafeSharedMemoryRegionWithRemote(
const base::UnsafeSharedMemoryRegion& region,
base::ProcessId remote_pid) override;
Expand Down
9 changes: 0 additions & 9 deletions ppapi/proxy/proxy_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,6 @@ IPC::PlatformFileForTransit ProxyChannel::ShareHandleWithRemote(
should_close_source);
}

base::SharedMemoryHandle ProxyChannel::ShareSharedMemoryHandleWithRemote(
const base::SharedMemoryHandle& handle) {
if (!channel_.get())
return base::SharedMemoryHandle();

DCHECK(peer_pid_ != base::kNullProcessId);
return delegate_->ShareSharedMemoryHandleWithRemote(handle, peer_pid_);
}

base::UnsafeSharedMemoryRegion
ProxyChannel::ShareUnsafeSharedMemoryRegionWithRemote(
const base::UnsafeSharedMemoryRegion& region) {
Expand Down
6 changes: 0 additions & 6 deletions ppapi/proxy/proxy_channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "base/files/scoped_file.h"
#include "base/macros.h"
#include "base/memory/read_only_shared_memory_region.h"
#include "base/memory/shared_memory.h"
#include "base/memory/unsafe_shared_memory_region.h"
#include "base/process/process.h"
#include "build/build_config.h"
Expand Down Expand Up @@ -62,9 +61,6 @@ class PPAPI_PROXY_EXPORT ProxyChannel
// because both sides of the channel may not have sufficient permission to
// duplicate handles directly. The implementation must provide the same
// guarantees as ProxyChannel::ShareSharedMemoryHandleWithRemote below.
virtual base::SharedMemoryHandle ShareSharedMemoryHandleWithRemote(
const base::SharedMemoryHandle& handle,
base::ProcessId remote_pid) = 0;
virtual base::UnsafeSharedMemoryRegion
ShareUnsafeSharedMemoryRegionWithRemote(
const base::UnsafeSharedMemoryRegion& region,
Expand Down Expand Up @@ -98,8 +94,6 @@ class PPAPI_PROXY_EXPORT ProxyChannel
// side then owns that handle. Note: if sending the message fails, the
// returned handle is properly closed by the IPC system. The original handle
// is not closed by this operation.
base::SharedMemoryHandle ShareSharedMemoryHandleWithRemote(
const base::SharedMemoryHandle& handle);
base::UnsafeSharedMemoryRegion ShareUnsafeSharedMemoryRegionWithRemote(
const base::UnsafeSharedMemoryRegion& region);
base::ReadOnlySharedMemoryRegion ShareReadOnlySharedMemoryRegionWithRemote(
Expand Down

0 comments on commit 778f23a

Please sign in to comment.