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

Unified Diff: ios/chrome/browser/crash_report/crash_keys.cc

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: ios/chrome/browser/crash_report/crash_keys.cc
diff --git a/ios/chrome/browser/crash_report/crash_keys.cc b/ios/chrome/browser/crash_report/crash_keys.cc
new file mode 100644
index 0000000000000000000000000000000000000000..1759249323a9523dfc039d5af4f8ca02adc946d0
--- /dev/null
+++ b/ios/chrome/browser/crash_report/crash_keys.cc
@@ -0,0 +1,34 @@
+// 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.
+
+#include "ios/chrome/browser/crash_report/crash_keys.h"
+
+#include "base/debug/crash_logging.h"
+#include "base/macros.h"
+#include "breakpad/src/common/simple_string_dictionary.h"
+#include "components/crash_keys/crash_keys.h"
+
+namespace {
+
+// The maximum lengths specified by breakpad include the trailing NULL, so
+// the actual length of the string is one less.
+static const size_t kSingleChunkLength =
+ google_breakpad::SimpleStringDictionary::value_size - 1;
+}
+
+size_t RegisterChromeIOSCrashKeys() {
+ // The following keys may be chunked by the underlying crash logging system,
+ // but ultimately constitute a single key-value pair.
+ base::debug::CrashKey fixed_keys[] = {
+ {crash_keys::kMetricsClientId, crash_keys::kSmallSize},
+ {crash_keys::kChannel, crash_keys::kSmallSize},
+ {crash_keys::kNumVariations, crash_keys::kSmallSize},
+ {crash_keys::kVariations, crash_keys::kLargeSize},
+ {crash_keys::mac::kZombie, crash_keys::kMediumSize},
+ {crash_keys::mac::kZombieTrace, crash_keys::kMediumSize},
+ };
+
+ return base::debug::InitCrashKeys(fixed_keys, arraysize(fixed_keys),
+ kSingleChunkLength);
+}

Powered by Google App Engine
This is Rietveld 408576698