Update V8 to version 4.7.24.
[chromium-blink-merge.git] / chromecast / crash / cast_crash_keys.cc
bloba33a257b585da0125374e1c321694d52844431ed
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 "chromecast/crash/cast_crash_keys.h"
7 // TODO(kjoswiak): Potentially refactor chunk size info as well as non-cast
8 // specific keys out and make shared with chrome/common/crash_keys.cc.
9 namespace {
11 // A small crash key, guaranteed to never be split into multiple pieces.
12 const size_t kSmallSize = 63;
14 // A medium crash key, which will be chunked on certain platforms but not
15 // others. Guaranteed to never be more than four chunks.
16 const size_t kMediumSize = kSmallSize * 4;
18 // A large crash key, which will be chunked on all platforms. This should be
19 // used sparingly.
20 const size_t kLargeSize = kSmallSize * 16;
22 // The maximum lengths specified by breakpad include the trailing NULL, so
23 // the actual length of the string is one less.
24 static const size_t kSingleChunkLength = 63;
28 namespace chromecast {
29 namespace crash_keys {
31 const char kLastApp[] = "last_app";
32 const char kCurrentApp[] = "current_app";
33 const char kPreviousApp[] = "previous_app";
35 size_t RegisterCastCrashKeys() {
36 const base::debug::CrashKey fixed_keys[] = {
37 { kLastApp, kSmallSize },
38 { kCurrentApp, kSmallSize },
39 { kPreviousApp, kSmallSize },
40 // content/:
41 { "discardable-memory-allocated", kSmallSize },
42 { "discardable-memory-free", kSmallSize },
43 { "ppapi_path", kMediumSize },
44 { "subresource_url", kLargeSize },
45 { "total-discardable-memory-allocated", kSmallSize },
48 return base::debug::InitCrashKeys(fixed_keys, arraysize(fixed_keys),
49 kSingleChunkLength);
52 } // namespace chromecast
53 } // namespace crash_keys