1 // Copyright 2018 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "base/memory/platform_shared_memory_region.h" 6 7 #include "base/memory/shared_memory_mapping.h" 8 9 namespace base { 10 namespace subtle { 11 12 // static 13 PlatformSharedMemoryRegion PlatformSharedMemoryRegion::CreateWritable( 14 size_t size) { 15 return Create(Mode::kWritable, size); 16 } 17 18 // static 19 PlatformSharedMemoryRegion PlatformSharedMemoryRegion::CreateUnsafe( 20 size_t size) { 21 return Create(Mode::kUnsafe, size); 22 } 23 24 PlatformSharedMemoryRegion::PlatformSharedMemoryRegion() = default; 25 PlatformSharedMemoryRegion::PlatformSharedMemoryRegion( 26 PlatformSharedMemoryRegion&& other) = default; 27 PlatformSharedMemoryRegion& PlatformSharedMemoryRegion::operator=( 28 PlatformSharedMemoryRegion&& other) = default; 29 PlatformSharedMemoryRegion::~PlatformSharedMemoryRegion() = default; 30 31 PlatformSharedMemoryRegion::ScopedPlatformHandle 32 PlatformSharedMemoryRegion::PassPlatformHandle() { 33 return std::move(handle_); 34 } 35 36 } // namespace subtle 37 } // namespace base 38