diff options
Diffstat (limited to 'libchrome_tools/patch/shared_memory_posix.patch')
-rw-r--r-- | libchrome_tools/patch/shared_memory_posix.patch | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/libchrome_tools/patch/shared_memory_posix.patch b/libchrome_tools/patch/shared_memory_posix.patch new file mode 100644 index 0000000000..abae9f455d --- /dev/null +++ b/libchrome_tools/patch/shared_memory_posix.patch @@ -0,0 +1,56 @@ +--- a/base/memory/shared_memory_posix.cc ++++ b/base/memory/shared_memory_posix.cc +@@ -27,6 +27,8 @@ + + #if defined(OS_ANDROID) + #include "base/os_compat_android.h" ++#endif ++#if defined(OS_ANDROID) || defined(__ANDROID__) + #include "third_party/ashmem/ashmem.h" + #endif + +@@ -96,7 +98,7 @@ bool SharedMemory::CreateAndMapAnonymous + return CreateAnonymous(size) && Map(size); + } + +-#if !defined(OS_ANDROID) ++#if !defined(OS_ANDROID) && !defined(__ANDROID__) + // static + bool SharedMemory::GetSizeFromSharedMemoryHandle( + const SharedMemoryHandle& handle, +@@ -255,7 +257,7 @@ bool SharedMemory::Open(const std::strin + return PrepareMapFile(std::move(fp), std::move(readonly_fd), &mapped_file_, + &readonly_mapped_file_); + } +-#endif // !defined(OS_ANDROID) ++#endif // !defined(OS_ANDROID) && !defined(__ANDROID__) + + bool SharedMemory::MapAt(off_t offset, size_t bytes) { + if (mapped_file_ == -1) +@@ -267,7 +269,7 @@ bool SharedMemory::MapAt(off_t offset, s + if (memory_) + return false; + +-#if defined(OS_ANDROID) ++#if defined(OS_ANDROID) || defined(__ANDROID__) + // On Android, Map can be called with a size and offset of zero to use the + // ashmem-determined size. + if (bytes == 0) { +@@ -332,7 +334,7 @@ void SharedMemory::Close() { + } + } + +-#if !defined(OS_ANDROID) ++#if !defined(OS_ANDROID) && !defined(__ANDROID__) + // For the given shmem named |mem_name|, return a filename to mmap() + // (and possibly create). Modifies |filename|. Return false on + // error, or true of we are happy. +@@ -355,7 +357,7 @@ bool SharedMemory::FilePathForMemoryName + *path = temp_dir.AppendASCII(name_base + ".shmem." + mem_name); + return true; + } +-#endif // !defined(OS_ANDROID) ++#endif // !defined(OS_ANDROID) && !defined(__ANDROID__) + + bool SharedMemory::ShareToProcessCommon(ProcessHandle process, + SharedMemoryHandle* new_handle, |