• Alexandr Ilin's avatar
    Reland "base: Introduce the new Shared Memory API" · 7b882500
    Alexandr Ilin authored
    This is a reland of cdd8661f
    
    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: default avatarAlexandr Ilin <alexilin@chromium.org>
    Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
    Reviewed-by: default avatarMatthew Cary <mattcary@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#546053}
    7b882500
process_memory_dump.h 13.2 KB