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

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: typedef -> using, %lu -> PRIuS 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
« no previous file with comments | « chrome/installer/setup/installer_crash_reporting.h ('k') | chrome/installer/setup/setup_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c41035c061524d98028b5dcee76f6f96d6cfdbba..0382b48b413d97983602ae541e45a2ab085fcb2a 100644
--- a/chrome/installer/setup/installer_crash_reporting.cc
+++ b/chrome/installer/setup/installer_crash_reporting.cc
@@ -4,6 +4,10 @@
#include "chrome/installer/setup/installer_crash_reporting.h"
+#include <iterator>
+#include <vector>
+
+#include "base/command_line.h"
#include "base/debug/crash_logging.h"
#include "base/debug/leak_annotations.h"
#include "base/logging.h"
@@ -127,7 +131,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);
}
@@ -146,4 +153,8 @@ void SetInitialCrashKeys(const InstallerState& state) {
SetCrashKeyValue(kStateKey, base::UTF16ToUTF8(state_key));
}
+void SetCrashKeysFromCommandLine(const base::CommandLine& command_line) {
+ crash_keys::SetSwitchesFromCommandLine(command_line, nullptr);
+}
+
} // namespace installer
« no previous file with comments | « chrome/installer/setup/installer_crash_reporting.h ('k') | chrome/installer/setup/setup_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698