commit | cdd8661f3f35d7075020ead0492cd83e18f795e9 | [log] [tgz] |
---|---|---|
author | Alexandr Ilin <alexilin@chromium.org> | Fri Mar 23 18:14:58 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Fri Mar 23 18:14:58 2018 |
tree | 53d8660974fd4961f3990f954d2a8838f5bfe472 | |
parent | 82c618ca932d637ef56ab2c4378010156c610c82 [diff] |
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}
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 .