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

Unified Diff: base/memory/shared_memory_posix.cc

Issue 2872503003: Add crash keys about field trial shared memory errors. (Closed)
Patch Set: Add TODOs about cleaning up the code. Created 3 years, 7 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
Index: base/memory/shared_memory_posix.cc
diff --git a/base/memory/shared_memory_posix.cc b/base/memory/shared_memory_posix.cc
index f44e3a27d10e66f0a8f6edee84bfe73854b0a22d..6066cb0426c140e610fd20e966830b2153d6ed45 100644
--- a/base/memory/shared_memory_posix.cc
+++ b/base/memory/shared_memory_posix.cc
@@ -118,8 +118,8 @@ bool SharedMemory::Create(const SharedMemoryCreateOptions& options) {
FilePath path;
if (options.name_deprecated == NULL || options.name_deprecated->empty()) {
- bool result =
- CreateAnonymousSharedMemory(options, &fp, &readonly_fd, &path);
+ bool result = CreateAnonymousSharedMemory(options, &fp, &readonly_fd, &path,
+ &last_error_);
if (!result)
return false;
} else {
@@ -210,8 +210,9 @@ bool SharedMemory::Create(const SharedMemoryCreateOptions& options) {
int mapped_file = -1;
int readonly_mapped_file = -1;
- bool result = PrepareMapFile(std::move(fp), std::move(readonly_fd),
- &mapped_file, &readonly_mapped_file);
+ bool result =
+ PrepareMapFile(std::move(fp), std::move(readonly_fd), &mapped_file,
+ &readonly_mapped_file, &last_error_);
shm_ = SharedMemoryHandle(base::FileDescriptor(mapped_file, false),
UnguessableToken::Create());
readonly_shm_ = SharedMemoryHandle(
@@ -250,8 +251,9 @@ bool SharedMemory::Open(const std::string& name, bool read_only) {
}
int mapped_file = -1;
int readonly_mapped_file = -1;
- bool result = PrepareMapFile(std::move(fp), std::move(readonly_fd),
- &mapped_file, &readonly_mapped_file);
+ bool result =
+ PrepareMapFile(std::move(fp), std::move(readonly_fd), &mapped_file,
+ &readonly_mapped_file, &last_error_);
// This form of sharing shared memory is deprecated. https://crbug.com/345734.
// However, we can't get rid of it without a significant refactor because its
// used to communicate between two versions of the same service process, very

Powered by Google App Engine
This is Rietveld 408576698