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

Unified Diff: chrome/installer/setup/installer_crash_reporting.cc

Issue 1481933002: Move crash keys for command-line switches to components/crash so they can be set (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@installer_crash_keys
Patch Set: Created 5 years, 1 month 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: chrome/installer/setup/installer_crash_reporting.cc
diff --git a/chrome/installer/setup/installer_crash_reporting.cc b/chrome/installer/setup/installer_crash_reporting.cc
index 8c829ff67fb158982b977f552062278560b347f6..03deb929008e002c93ba7f65b25883521e0eedd8 100644
--- a/chrome/installer/setup/installer_crash_reporting.cc
+++ b/chrome/installer/setup/installer_crash_reporting.cc
@@ -4,6 +4,7 @@
#include "chrome/installer/setup/installer_crash_reporting.h"
+#include "base/command_line.h"
#include "base/debug/leak_annotations.h"
#include "base/logging.h"
#include "base/strings/utf_string_conversions.h"
@@ -125,7 +126,10 @@ size_t RegisterCrashKeys() {
// kLargeSize, which is wasteful.)
{ kStateKey, crash_keys::kMediumSize },
};
- return base::debug::InitCrashKeys(&kFixedKeys[0], arraysize(kFixedKeys),
+ std::vector<base::debug::CrashKey> keys(std::begin(kFixedKeys),
+ std::end(kFixedKeys));
+ crash_keys::GetCrashKeysForCommandLineSwitches(&keys);
+ return base::debug::InitCrashKeys(keys.data(), keys.size(),
crash_keys::kChunkMaxLength);
}
@@ -144,4 +148,8 @@ void SetInitialCrashKeys(const InstallerState& state) {
SetCrashKeyValue(kStateKey, base::UTF16ToUTF8(state_key));
}
+void SetCrashKeysFromCommandLine(const base::CommandLine& command_line) {
+ crash_keys::SetSwitchesFromCommandLine(command_line);
+}
+
} // namespace installer

Powered by Google App Engine
This is Rietveld 408576698