platform_shared_memory_mapper.h 1005 B

12345678910111213141516171819202122232425262728
  1. // Copyright 2022 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. #ifndef BASE_MEMORY_PLATFORM_SHARED_MEMORY_MAPPER_H_
  5. #define BASE_MEMORY_PLATFORM_SHARED_MEMORY_MAPPER_H_
  6. #include "base/base_export.h"
  7. #include "base/memory/shared_memory_mapper.h"
  8. namespace base {
  9. // Default implementation of the SharedMemoryMapper interface. Implements the
  10. // platform-specific logic for mapping shared memory regions into the virtual
  11. // address space of the process.
  12. class PlatformSharedMemoryMapper : public SharedMemoryMapper {
  13. public:
  14. absl::optional<span<uint8_t>> Map(subtle::PlatformSharedMemoryHandle handle,
  15. bool write_allowed,
  16. uint64_t offset,
  17. size_t size) override;
  18. void Unmap(span<uint8_t> mapping) override;
  19. };
  20. } // namespace base
  21. #endif // BASE_MEMORY_PLATFORM_SHARED_MEMORY_MAPPER_H_