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

Unified Diff: chrome/common/crash_keys.h

Issue 1000203007: Set a "metrics_client_id" crash key instead of "guid" on Mac OS X (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase, don't include useless switches Created 5 years, 9 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: chrome/common/crash_keys.h
diff --git a/chrome/common/crash_keys.h b/chrome/common/crash_keys.h
index d9dd52e8f31c7f4a938f5a635bfb3e7c51c91223..ff1b6458cbbbfc3b45d9c3f3887720c8c7db22b4 100644
--- a/chrome/common/crash_keys.h
+++ b/chrome/common/crash_keys.h
@@ -21,11 +21,21 @@ namespace crash_keys {
// reporting server. Returns the size of the union of all keys.
size_t RegisterChromeCrashKeys();
-// Sets the ID (based on |client_guid| which may either be a full GUID or a
-// GUID that was already stripped from its dashes -- in either cases this method
-// will strip remaining dashes before setting the crash key) by which this crash
-// reporting client can be identified.
+// Sets the ID (which may either be a full GUID or a GUID that was already
+// stripped from its dashes -- in either case this method will strip remaining
+// dashes before setting the crash key) by which this crash reporting client can
+// be identified.
+#if defined(OS_MACOSX)
+// Under Crashpad, the crash client ID is Crashpad's responsibility, and cannot
+// be set directly by Chrome. The metrics client ID is distinct from the crash
+// client ID and is set as a crash key. When metrics recording is disabled, the
+// metrics client ID will be cleared.
+void SetMetricsClientIdFromGUID(const std::string& metrics_client_guid);
+void ClearMetricsClientId();
+#else
+// Under Breakpad, the crash client ID and the metrics client ID are the same.
void SetCrashClientIdFromGUID(const std::string& client_guid);
+#endif
// Sets the kSwitch and kNumSwitches keys based on the given |command_line|.
void SetSwitchesFromCommandLine(const base::CommandLine* command_line);
@@ -54,8 +64,13 @@ class ScopedPrinterInfo {
// Crash Key Name Constants ////////////////////////////////////////////////////
-// The GUID used to identify this client to the crash system.
+#if defined(OS_MACOSX)
+// The GUID used to identify this client to the crash system. On Mac OS X, this
+// is the responsibility of Crashpad, and is not set directly by Chrome.
+extern const char kMetricsClientID[];
+#else
extern const char kClientID[];
+#endif
// The product release/distribution channel.
extern const char kChannel[];

Powered by Google App Engine
This is Rietveld 408576698