commit | 7b882500303dd0c9a416dc6330530de02e76f2b7 | [log] [tgz] |
---|---|---|
author | Alexandr Ilin <alexilin@chromium.org> | Tue Mar 27 07:44:53 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Tue Mar 27 07:44:53 2018 |
tree | d01202e0415f07e61fddafb5f7cf40bc1ee4c500 | |
parent | 86496528533643230431dfb13af6ecb59ffa6c62 [diff] |
Reland "base: Introduce the new Shared Memory API" This is a reland of cdd8661f3f35d7075020ead0492cd83e18f795e9 Reason for reland: The failing test PlatformSharedMemoryRegionTest.MapAtWithOverflowTest was fixed. Original change's description: > base: Introduce the new Shared Memory API > > Design doc (public): https://goo.gl/HmBYy6 > > This patch proposes the new API for the Shared Memory based on two > concepts, a shared memory region and a shared memory mapping. The > region controls the platform-specific handle and mediates sharing and > access control. The mapping is just a reference to the memory bytes > which knows how to unmap itself. Ownership is per-instance: neither a > region nor a mapping may be copied, and resources are freed when then > instance dies. This is accomplished through move-only semantics. > > The goal of the new API is to provide a correct cross-platform > implementation that makes the sharing mode explicit via the C++ type > system. > > Thus, this CL introduces two classes for shared memory mappings: > - WritableSharedMemoryMapping owns and provides an access to writable > shared memory > - ReadOnlySharedMemoryMapping for read-only shared memory > > and three classes representing shared memory regions: > - UnsafeSharedMemoryRegion allows to create > WritableSharedMemoryMapping instances and cannot be used for making > read-only mappings > - ReadOnlySharedMemoryRegion, on the contrary, can produce only > ReadOnlySharedMemoryMapping instances and it also creates one writable > mapping in the caller process address space > - WritableSharedMemoryRegion allows to create writable > mappings and can be eventually converted to ReadOnlySharedMemoryRegion. > The important limitation in comparison with UnsafeSharedMemoryRegion > is that the WritableSharedMemoryRegion cannot be duplicated so in > order to pass the writable region to another process, the ownership of > the region must be moved/transferred to this process. > > Bug: 795291 > Change-Id: I7d1d0a24932145cc0f449b01ceb8cafef9b7e407 > Reviewed-on: https://chromium-review.googlesource.com/893458 > Commit-Queue: Alexandr Ilin <alexilin@chromium.org> > Reviewed-by: Matthew Cary <mattcary@chromium.org> > Reviewed-by: Daniel Cheng <dcheng@chromium.org> > Reviewed-by: Erik Chen <erikchen@chromium.org> > Reviewed-by: Robert Sesek <rsesek@chromium.org> > Reviewed-by: Ken Rockot <rockot@chromium.org> > Cr-Commit-Position: refs/heads/master@{#545521} TBR=dcheng@chromium.org,erikchen@chromium.org,rsesek@chromium.org,rockot@chromium.org Bug: 795291 Change-Id: Ibba9aac8e7ca5bb6c55a2e0ddf62178fdc8fae20 Reviewed-on: https://chromium-review.googlesource.com/979653 Commit-Queue: Alexandr Ilin <alexilin@chromium.org> Reviewed-by: Alexandr Ilin <alexilin@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Matthew Cary <mattcary@chromium.org> Cr-Commit-Position: refs/heads/master@{#546053}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .