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 #include "ios/chrome/browser/crash_report/crash_keys.h"
7 #include "base/debug/crash_logging.h"
8 #include "base/macros.h"
9 #include "breakpad/src/common/simple_string_dictionary.h"
10 #include "components/crash_keys/crash_keys.h"
14 // The maximum lengths specified by breakpad include the trailing NULL, so
15 // the actual length of the string is one less.
16 static const size_t kSingleChunkLength
=
17 google_breakpad::SimpleStringDictionary::value_size
- 1;
20 size_t RegisterChromeIOSCrashKeys() {
21 // The following keys may be chunked by the underlying crash logging system,
22 // but ultimately constitute a single key-value pair.
23 base::debug::CrashKey fixed_keys
[] = {
24 {crash_keys::kBug464926CrashKey
, crash_keys::kSmallSize
},
25 {crash_keys::kChannel
, crash_keys::kSmallSize
},
26 {crash_keys::kMetricsClientId
, crash_keys::kSmallSize
},
27 {crash_keys::kNumVariations
, crash_keys::kSmallSize
},
28 {crash_keys::kVariations
, crash_keys::kLargeSize
},
29 {crash_keys::mac::kZombie
, crash_keys::kMediumSize
},
30 {crash_keys::mac::kZombieTrace
, crash_keys::kMediumSize
},
33 return base::debug::InitCrashKeys(fixed_keys
, arraysize(fixed_keys
),