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

Unified Diff: components/crash_keys/crash_keys.h

Issue 1298743002: Partially componentize chrome/common/crash_keys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation on iOS Created 5 years, 4 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: components/crash_keys/crash_keys.h
diff --git a/components/crash_keys/crash_keys.h b/components/crash_keys/crash_keys.h
new file mode 100644
index 0000000000000000000000000000000000000000..c3a1099f5650485067bca02e7a79c901d8eaf492
--- /dev/null
+++ b/components/crash_keys/crash_keys.h
@@ -0,0 +1,74 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_CRASH_KEYS_CRASH_KEYS_H_
+#define COMPONENTS_CRASH_KEYS_CRASH_KEYS_H_
+
+#include <string>
+#include <vector>
+
+#include "build/build_config.h"
+
+namespace crash_keys {
+
+// 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).
+void SetMetricsClientIdFromGUID(const std::string& metrics_client_guid);
+void ClearMetricsClientId();
+
+// Sets the list of active experiment/variations info.
+void SetVariationsList(const std::vector<std::string>& variations);
+
+// Crash Key Constants /////////////////////////////////////////////////////////
+
+// A small crash key, guaranteed to never be split into multiple pieces.
+const size_t kSmallSize = 63;
+
+// A medium crash key, which will be chunked on certain platforms but not
+// others. Guaranteed to never be more than four chunks.
+const size_t kMediumSize = kSmallSize * 4;
+
+// A large crash key, which will be chunked on all platforms. This should be
+// used sparingly.
+const size_t kLargeSize = kSmallSize * 16;
+
+// Crash Key Name Constants ////////////////////////////////////////////////////
+
+// The GUID used to identify this client to the crash system.
+#if defined(OS_MACOSX)
+// On Mac OS X, the crash reporting client ID is the responsibility of Crashpad.
+// It is not set directly by Chrome. To make the metrics client ID available on
+// the server, it's stored in a distinct key.
+extern const char kMetricsClientId[];
+#else
+// When using Breakpad instead of Crashpad, the crash reporting client ID is the
+// same as the metrics client ID.
+extern const char kClientId[];
+#endif
+
+// The product release/distribution channel.
+extern const char kChannel[];
+
+// The total number of experiments the instance has.
+extern const char kNumVariations[];
+
+// The experiments chunk. Hashed experiment names separated by |,|. This is
+// typically set by SetExperimentList.
+extern const char kVariations[];
+
+#if defined(OS_MACOSX)
+namespace mac {
+
+// Records Cocoa zombie/used-after-freed objects that resulted in a
+// deliberate crash.
+extern const char kZombie[];
+extern const char kZombieTrace[];
+
+} // namespace mac
+#endif
+
+} // namespace crash_keys
+
+#endif // COMPONENTS_CRASH_KEYS_CRASH_KEYS_H_

Powered by Google App Engine
This is Rietveld 408576698