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

Unified Diff: base/metrics/field_trial.cc

Issue 2872503003: Add crash keys about field trial shared memory errors. (Closed)
Patch Set: Rebased 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
« no previous file with comments | « base/memory/shared_memory_posix.cc ('k') | chrome/app/chrome_crash_reporter_client_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/field_trial.cc
diff --git a/base/metrics/field_trial.cc b/base/metrics/field_trial.cc
index 78602f1e613d39f00020dea6f1f18f093bcfa72f..9a0121635830b943057e40a9eece6fa35ee74ca8 100644
--- a/base/metrics/field_trial.cc
+++ b/base/metrics/field_trial.cc
@@ -11,6 +11,7 @@
#include "base/build_time.h"
#include "base/command_line.h"
#include "base/debug/activity_tracker.h"
+#include "base/debug/crash_logging.h"
#include "base/logging.h"
#include "base/metrics/field_trial_param_associator.h"
#include "base/process/memory.h"
@@ -1230,11 +1231,25 @@ void FieldTrialList::InstantiateFieldTrialAllocatorIfNeeded() {
#endif
std::unique_ptr<SharedMemory> shm(new SharedMemory());
- if (!shm->Create(options))
+ if (!shm->Create(options)) {
+#if !defined(OS_NACL)
+ // Temporary for http://crbug.com/703649.
+ base::debug::ScopedCrashKey crash_key(
+ "field_trial_shmem_create_error",
+ base::IntToString(static_cast<int>(shm->get_last_error())));
+#endif
OnOutOfMemory(kFieldTrialAllocationSize);
+ }
- if (!shm->Map(kFieldTrialAllocationSize))
+ if (!shm->Map(kFieldTrialAllocationSize)) {
+#if !defined(OS_NACL)
+ // Temporary for http://crbug.com/703649.
+ base::debug::ScopedCrashKey crash_key(
+ "field_trial_shmem_map_error",
+ base::IntToString(static_cast<int>(shm->get_last_error())));
+#endif
OnOutOfMemory(kFieldTrialAllocationSize);
+ }
global_->field_trial_allocator_.reset(
new FieldTrialAllocator(std::move(shm), 0, kAllocatorName, false));
« no previous file with comments | « base/memory/shared_memory_posix.cc ('k') | chrome/app/chrome_crash_reporter_client_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698