1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_CRASH_KEYS_CRASH_KEYS_H_
6 #define COMPONENTS_CRASH_KEYS_CRASH_KEYS_H_
11 #include "build/build_config.h"
13 namespace crash_keys
{
15 // Sets the ID (which may either be a full GUID or a GUID that was already
16 // stripped from its dashes -- in either case this method will strip remaining
17 // dashes before setting the crash key).
18 void SetMetricsClientIdFromGUID(const std::string
& metrics_client_guid
);
19 void ClearMetricsClientId();
21 // Sets the list of active experiment/variations info.
22 void SetVariationsList(const std::vector
<std::string
>& variations
);
24 // Crash Key Constants /////////////////////////////////////////////////////////
26 // A small crash key, guaranteed to never be split into multiple pieces.
27 const size_t kSmallSize
= 63;
29 // A medium crash key, which will be chunked on certain platforms but not
30 // others. Guaranteed to never be more than four chunks.
31 const size_t kMediumSize
= kSmallSize
* 4;
33 // A large crash key, which will be chunked on all platforms. This should be
35 const size_t kLargeSize
= kSmallSize
* 16;
37 // Crash Key Name Constants ////////////////////////////////////////////////////
39 // The GUID used to identify this client to the crash system.
40 #if defined(OS_MACOSX)
41 // On Mac OS X, the crash reporting client ID is the responsibility of Crashpad.
42 // It is not set directly by Chrome. To make the metrics client ID available on
43 // the server, it's stored in a distinct key.
44 extern const char kMetricsClientId
[];
46 // When using Breakpad instead of Crashpad, the crash reporting client ID is the
47 // same as the metrics client ID.
48 extern const char kClientId
[];
51 // The product release/distribution channel.
52 extern const char kChannel
[];
54 // The total number of experiments the instance has.
55 extern const char kNumVariations
[];
57 // The experiments chunk. Hashed experiment names separated by |,|. This is
58 // typically set by SetExperimentList.
59 extern const char kVariations
[];
61 // Used to help investigate bug 464926.
62 extern const char kBug464926CrashKey
[];
64 #if defined(OS_MACOSX)
67 // Records Cocoa zombie/used-after-freed objects that resulted in a
69 extern const char kZombie
[];
70 extern const char kZombieTrace
[];
75 } // namespace crash_keys
77 #endif // COMPONENTS_CRASH_KEYS_CRASH_KEYS_H_