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

Unified Diff: chromecast/crash/cast_crash_keys.cc

Issue 923263004: Enable crash keys for cast shell on android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed namespace Created 5 years, 10 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
« no previous file with comments | « chromecast/crash/cast_crash_keys.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/crash/cast_crash_keys.cc
diff --git a/chromecast/crash/cast_crash_keys.cc b/chromecast/crash/cast_crash_keys.cc
new file mode 100644
index 0000000000000000000000000000000000000000..6ca240f8fd3944aafe9d54bade1694d96dd78199
--- /dev/null
+++ b/chromecast/crash/cast_crash_keys.cc
@@ -0,0 +1,53 @@
+// 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 "chromecast/crash/cast_crash_keys.h"
+
+// TODO(kjoswiak): Potentially refactor chunk size info as well as non-cast
+// specific keys out and make shared with chrome/common/crash_keys.cc.
+namespace {
+
+// 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;
+
+// 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 = 63;
+
+}
+
+namespace chromecast {
+namespace crash_keys {
+
+const char kLastApp[] = "last_app";
+const char kCurrentApp[] = "current_app";
+const char kPreviousApp[] = "previous_app";
+
+size_t RegisterCastCrashKeys() {
+ const base::debug::CrashKey fixed_keys[] = {
+ { kLastApp, kSmallSize },
+ { kCurrentApp, kSmallSize },
+ { kPreviousApp, kSmallSize },
+ // base/:
+ { "dm-usage", kSmallSize },
+ { "total-dm-usage", kSmallSize },
+ // content/:
+ { "ppapi_path", kMediumSize },
+ { "subresource_url", kLargeSize },
+ };
+
+ return base::debug::InitCrashKeys(fixed_keys, arraysize(fixed_keys),
+ kSingleChunkLength);
+}
+
+} // namespace chromecast
+} // namespace crash_keys
« no previous file with comments | « chromecast/crash/cast_crash_keys.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698