#include "base/memory/platform_shared_memory_region.h"
#include <fcntl.h>
#include <sys/mman.h>
#include "base/files/file.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
namespace base {
namespace subtle {
namespace {
struct ScopedPathUnlinkerTraits { … };
ScopedPathUnlinker;
#if !BUILDFLAG(IS_NACL)
bool CheckFDAccessMode(int fd, int expected_mode) { … }
#endif
}
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
ScopedFD PlatformSharedMemoryRegion::ExecutableRegion::CreateFD(size_t size) { … }
#endif
PlatformSharedMemoryRegion PlatformSharedMemoryRegion::Take(
ScopedFDPair handle,
Mode mode,
size_t size,
const UnguessableToken& guid) { … }
PlatformSharedMemoryRegion PlatformSharedMemoryRegion::Take(
ScopedFD handle,
Mode mode,
size_t size,
const UnguessableToken& guid) { … }
FDPair PlatformSharedMemoryRegion::GetPlatformHandle() const { … }
bool PlatformSharedMemoryRegion::IsValid() const { … }
PlatformSharedMemoryRegion PlatformSharedMemoryRegion::Duplicate() const { … }
bool PlatformSharedMemoryRegion::ConvertToReadOnly() { … }
bool PlatformSharedMemoryRegion::ConvertToUnsafe() { … }
PlatformSharedMemoryRegion PlatformSharedMemoryRegion::Create(Mode mode,
size_t size
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
,
bool executable
#endif
) { … }
bool PlatformSharedMemoryRegion::CheckPlatformHandlePermissionsCorrespondToMode(
PlatformSharedMemoryHandle handle,
Mode mode,
size_t size) { … }
PlatformSharedMemoryRegion::PlatformSharedMemoryRegion(
ScopedFDPair handle,
Mode mode,
size_t size,
const UnguessableToken& guid)
: … { … }
}
}