Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(628)

Unified Diff: base/memory/shared_memory_posix.cc

Issue 1163943004: Make SharedMemoryHandle a class on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shared_memory_make_class3_base
Patch Set: Remove more unused headers that magically appeared from rebase. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/memory/shared_memory_nacl.cc ('k') | base/memory/shared_memory_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/shared_memory_posix.cc
diff --git a/base/memory/shared_memory_posix.cc b/base/memory/shared_memory_posix.cc
index 8aaa9ce443890f64140c06cb9e0a4b410bdf711d..2e66b34cfcd7b5d3bcf8c0a10c90ea02e6dd28db 100644
--- a/base/memory/shared_memory_posix.cc
+++ b/base/memory/shared_memory_posix.cc
@@ -19,10 +19,6 @@
#include "base/scoped_generic.h"
#include "base/strings/utf_string_conversions.h"
-#if defined(OS_MACOSX)
-#include "base/mac/foundation_util.h"
-#endif // OS_MACOSX
-
#if defined(OS_ANDROID)
#include "base/os_compat_android.h"
#include "third_party/ashmem/ashmem.h"
@@ -110,7 +106,7 @@ SharedMemory::SharedMemory()
requested_size_(0) {
}
-SharedMemory::SharedMemory(SharedMemoryHandle handle, bool read_only)
+SharedMemory::SharedMemory(const SharedMemoryHandle& handle, bool read_only)
: mapped_file_(handle.fd),
readonly_mapped_file_(-1),
mapped_size_(0),
@@ -119,7 +115,8 @@ SharedMemory::SharedMemory(SharedMemoryHandle handle, bool read_only)
requested_size_(0) {
}
-SharedMemory::SharedMemory(SharedMemoryHandle handle, bool read_only,
+SharedMemory::SharedMemory(const SharedMemoryHandle& handle,
+ bool read_only,
ProcessHandle process)
: mapped_file_(handle.fd),
readonly_mapped_file_(-1),
@@ -290,7 +287,6 @@ bool SharedMemory::Create(const SharedMemoryCreateOptions& options) {
requested_size_ = options.size;
}
if (fp == NULL) {
-#if !defined(OS_MACOSX)
PLOG(ERROR) << "Creating shared memory in " << path.value() << " failed";
FilePath dir = path.DirName();
if (access(dir.value().c_str(), W_OK | X_OK) < 0) {
@@ -300,9 +296,6 @@ bool SharedMemory::Create(const SharedMemoryCreateOptions& options) {
<< "/dev/shm. Try 'sudo chmod 1777 /dev/shm' to fix.";
}
}
-#else
- PLOG(ERROR) << "Creating shared memory in " << path.value() << " failed";
-#endif
return false;
}
@@ -459,15 +452,11 @@ bool SharedMemory::FilePathForMemoryName(const std::string& mem_name,
if (!GetShmemTempDir(false, &temp_dir))
return false;
-#if !defined(OS_MACOSX)
#if defined(GOOGLE_CHROME_BUILD)
std::string name_base = std::string("com.google.Chrome");
#else
std::string name_base = std::string("org.chromium.Chromium");
#endif
-#else // OS_MACOSX
- std::string name_base = std::string(base::mac::BaseBundleID());
-#endif // OS_MACOSX
*path = temp_dir.AppendASCII(name_base + ".shmem." + mem_name);
return true;
}
« no previous file with comments | « base/memory/shared_memory_nacl.cc ('k') | base/memory/shared_memory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698