| // Copyright 2018 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| // Note: |
| // 1. This file is copied from |
| // "src/platform2/media_perception/mojom/shared_memory.mojom" in the CrOS |
| // repo. |
| // 2. On chromium, we must use the standard version, i.e., |
| // "mojo/public/mojom/base/shared_memory.mojom" in the chromium repo and |
| // must not sync this file to chromium. |
| |
| module mojo_base.mojom; |
| |
| // Wraps a shared memory handle with additional type information to convey that |
| // the handle is only mappable to read-only memory. |
| [Stable] |
| struct ReadOnlySharedMemoryRegion { |
| handle<shared_buffer> buffer; |
| }; |
| |
| // Wraps a shared memory handle with additional type information to convey that |
| // the handle is mappable to writable memory but can also be converted to |
| // a ReadOnlySharedMemoryRegion for sharing with other clients. |
| [Stable] |
| struct WritableSharedMemoryRegion { |
| handle<shared_buffer> buffer; |
| }; |
| |
| // Wraps a shared memory handle with additional type information to convey that |
| // the handle is always mappable to writable memory by any client which obtains |
| // a handle duplicated from this one. |
| [Stable] |
| struct UnsafeSharedMemoryRegion { |
| handle<shared_buffer> buffer; |
| }; |