New issue
Advanced search Search tips

Issue 845985 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Task

Blocking:
issue 795291
issue 844456
issue 844508



Sign in to add a comment

ppapi::proxy::SerializedHandle should support the new shared memory API

Project Member Reported by alexilin@chromium.org, May 23 2018

Issue description

SerializedHandle is a unified structure for holding a handle (e.g., a shared memory handle, socket descriptor, etc) that is used in pepper. It should be possible to use with new shared memory classes.

During the transition period SerializedHandle should support both the old and the new shared memory classes, thus I propose to add a new SerializedHandle::Type::SHARED_MEMORY_REGION and add a base::subtle::PlatformSharedMemoryRegion member into the class. Later, the old SHARED_MEMORY type will be removed along with the base::SharedMemoryHandle member.
 
Alternative implementation would be to have something similar to what mojo currently has. A shared memory in SerializedHandle would be represented by a PlatformSharedMemoryRegion but callers will be still able to wrap/unwrap SharedMemoryHandle's.
Note this may overlap a bit with crbug.com/844456, as BitstreamBuffers interact with ppapi as well. See the links in that bug. I'm still investigating.
Blocking: 844456
Components: Internals>Plugins>Pepper
Status: Started (was: Assigned)
Project Member

Comment 5 by bugdroid1@chromium.org, May 30 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1d004107b1a503bf971a246337515a4b35aca2dd

commit 1d004107b1a503bf971a246337515a4b35aca2dd
Author: Alexandr Ilin <alexilin@chromium.org>
Date: Wed May 30 10:55:32 2018

ppapi: Make SerializedHandle class move-only

This CL deletes the copy constructor and the copy assignment operator from the
ppapi::proxy::SerializedHandle class replacing them with move operations. This
is preparatory step to make SerializedHandle using the new shared memory
classes that are move-only.

SerializedHandle holds a system resource that should be properly closed after
use. Move semantics allow to introduce the more clear ownership model and
prevent resource leaks.

Bug:  845985 
Change-Id: Ie7202d18f4f0396133c53ee0faee111e07c58ee8
Reviewed-on: https://chromium-review.googlesource.com/1073200
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Alexandr Ilin <alexilin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#562796}
[modify] https://crrev.com/1d004107b1a503bf971a246337515a4b35aca2dd/components/nacl/loader/nacl_ipc_adapter.cc
[modify] https://crrev.com/1d004107b1a503bf971a246337515a4b35aca2dd/content/browser/renderer_host/pepper/pepper_file_io_host.cc
[modify] https://crrev.com/1d004107b1a503bf971a246337515a4b35aca2dd/content/renderer/pepper/pepper_audio_input_host.cc
[modify] https://crrev.com/1d004107b1a503bf971a246337515a4b35aca2dd/content/renderer/pepper/pepper_audio_output_host.cc
[modify] https://crrev.com/1d004107b1a503bf971a246337515a4b35aca2dd/content/renderer/pepper/pepper_media_stream_track_host_base.cc
[modify] https://crrev.com/1d004107b1a503bf971a246337515a4b35aca2dd/content/renderer/pepper/pepper_video_decoder_host.cc
[modify] https://crrev.com/1d004107b1a503bf971a246337515a4b35aca2dd/content/renderer/pepper/pepper_video_encoder_host.cc
[modify] https://crrev.com/1d004107b1a503bf971a246337515a4b35aca2dd/content/renderer/pepper/pepper_video_source_host.cc
[modify] https://crrev.com/1d004107b1a503bf971a246337515a4b35aca2dd/ppapi/host/ppapi_host.cc
[modify] https://crrev.com/1d004107b1a503bf971a246337515a4b35aca2dd/ppapi/host/ppapi_host.h
[modify] https://crrev.com/1d004107b1a503bf971a246337515a4b35aca2dd/ppapi/proxy/nacl_message_scanner.cc
[modify] https://crrev.com/1d004107b1a503bf971a246337515a4b35aca2dd/ppapi/proxy/resource_message_params.cc
[modify] https://crrev.com/1d004107b1a503bf971a246337515a4b35aca2dd/ppapi/proxy/resource_message_params.h
[modify] https://crrev.com/1d004107b1a503bf971a246337515a4b35aca2dd/ppapi/proxy/resource_message_test_sink.cc
[modify] https://crrev.com/1d004107b1a503bf971a246337515a4b35aca2dd/ppapi/proxy/resource_message_test_sink.h
[modify] https://crrev.com/1d004107b1a503bf971a246337515a4b35aca2dd/ppapi/proxy/serialized_handle.cc
[modify] https://crrev.com/1d004107b1a503bf971a246337515a4b35aca2dd/ppapi/proxy/serialized_handle.h
[modify] https://crrev.com/1d004107b1a503bf971a246337515a4b35aca2dd/ppapi/proxy/video_decoder_resource_unittest.cc
[modify] https://crrev.com/1d004107b1a503bf971a246337515a4b35aca2dd/ppapi/proxy/video_encoder_resource_unittest.cc

Project Member

Comment 6 by bugdroid1@chromium.org, Jun 1 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ebab9dadca758f4d3f0e0412a108cfc85a228536

commit ebab9dadca758f4d3f0e0412a108cfc85a228536
Author: Alexandr Ilin <alexilin@chromium.org>
Date: Fri Jun 01 02:37:47 2018

ppapi: Add SHARED_MEMORY_REGION type to SerializedHandle

This CL adds a new SHARED_MEMORY_REGION type to the SerializedHandle. This new
type is backed up by the base::subtle::PlatformSharedMemoryRegion class that
provides a new recommended API for the shared memory in Chrome.
Eventually, all uses of the SHARED_MEMORY type should be converted to the
SHARED_MEMORY_REGION.

Bug:  845985 
Change-Id: Icfb4605dadb6f111efe953d8b940cc879fa40763
Reviewed-on: https://chromium-review.googlesource.com/1076334
Reviewed-by: Ken Rockot <rockot@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Commit-Queue: Alexandr Ilin <alexilin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#563500}
[modify] https://crrev.com/ebab9dadca758f4d3f0e0412a108cfc85a228536/components/nacl/loader/nacl_ipc_adapter.cc
[modify] https://crrev.com/ebab9dadca758f4d3f0e0412a108cfc85a228536/ipc/ipc_message_utils.cc
[modify] https://crrev.com/ebab9dadca758f4d3f0e0412a108cfc85a228536/ppapi/proxy/nacl_message_scanner.cc
[modify] https://crrev.com/ebab9dadca758f4d3f0e0412a108cfc85a228536/ppapi/proxy/ppapi_param_traits.cc
[modify] https://crrev.com/ebab9dadca758f4d3f0e0412a108cfc85a228536/ppapi/proxy/serialized_handle.cc
[modify] https://crrev.com/ebab9dadca758f4d3f0e0412a108cfc85a228536/ppapi/proxy/serialized_handle.h

Project Member

Comment 7 by bugdroid1@chromium.org, Jun 1 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c7d975fa69a1cbbda32b8a8a48a40305f3eb70ff

commit c7d975fa69a1cbbda32b8a8a48a40305f3eb70ff
Author: Alexandr Ilin <alexilin@chromium.org>
Date: Fri Jun 01 09:25:41 2018

ppapi: Add methods for sharing new shared memory classes with remote

This CL adds two new methods, ShareUnsafeSharedMemoryRegionWithRemote() and
ShareReadOnlySharedMemoryRegionWithRemote() to
ppapi::proxy::ProxyChannel::Delegate and to content::RendererPpapiHost classes
and all implementation classes.

These new methods are similar to the SharedSharedMemoryHandleWithRemote()
method in those classes but are supposed to work with the new shared memory
API.

Bug:  845985 
Change-Id: I8ccd92a1c81dca9495c85119e9a4e40fd6b69abf
Reviewed-on: https://chromium-review.googlesource.com/1078847
Commit-Queue: Alexandr Ilin <alexilin@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#563571}
[modify] https://crrev.com/c7d975fa69a1cbbda32b8a8a48a40305f3eb70ff/components/pdf/renderer/pdf_accessibility_tree_browsertest.cc
[modify] https://crrev.com/c7d975fa69a1cbbda32b8a8a48a40305f3eb70ff/content/ppapi_plugin/ppapi_thread.cc
[modify] https://crrev.com/c7d975fa69a1cbbda32b8a8a48a40305f3eb70ff/content/ppapi_plugin/ppapi_thread.h
[modify] https://crrev.com/c7d975fa69a1cbbda32b8a8a48a40305f3eb70ff/content/public/renderer/renderer_ppapi_host.h
[modify] https://crrev.com/c7d975fa69a1cbbda32b8a8a48a40305f3eb70ff/content/renderer/pepper/mock_renderer_ppapi_host.cc
[modify] https://crrev.com/c7d975fa69a1cbbda32b8a8a48a40305f3eb70ff/content/renderer/pepper/mock_renderer_ppapi_host.h
[modify] https://crrev.com/c7d975fa69a1cbbda32b8a8a48a40305f3eb70ff/content/renderer/pepper/pepper_proxy_channel_delegate_impl.cc
[modify] https://crrev.com/c7d975fa69a1cbbda32b8a8a48a40305f3eb70ff/content/renderer/pepper/pepper_proxy_channel_delegate_impl.h
[modify] https://crrev.com/c7d975fa69a1cbbda32b8a8a48a40305f3eb70ff/content/renderer/pepper/renderer_ppapi_host_impl.cc
[modify] https://crrev.com/c7d975fa69a1cbbda32b8a8a48a40305f3eb70ff/content/renderer/pepper/renderer_ppapi_host_impl.h
[modify] https://crrev.com/c7d975fa69a1cbbda32b8a8a48a40305f3eb70ff/ppapi/nacl_irt/ppapi_dispatcher.cc
[modify] https://crrev.com/c7d975fa69a1cbbda32b8a8a48a40305f3eb70ff/ppapi/nacl_irt/ppapi_dispatcher.h
[modify] https://crrev.com/c7d975fa69a1cbbda32b8a8a48a40305f3eb70ff/ppapi/proxy/ppapi_proxy_test.cc
[modify] https://crrev.com/c7d975fa69a1cbbda32b8a8a48a40305f3eb70ff/ppapi/proxy/ppapi_proxy_test.h
[modify] https://crrev.com/c7d975fa69a1cbbda32b8a8a48a40305f3eb70ff/ppapi/proxy/proxy_channel.cc
[modify] https://crrev.com/c7d975fa69a1cbbda32b8a8a48a40305f3eb70ff/ppapi/proxy/proxy_channel.h

Status: Fixed (was: Started)
It's fixed now. Now we need to remove all usages of SerializedHandle::Type::SHARED_MEMORY. Different use-cases are tracked separately.

Sign in to add a comment