OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #include "chromecast/crash/cast_crash_keys.h" |
| 6 |
| 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 { |
| 10 |
| 11 // A small crash key, guaranteed to never be split into multiple pieces. |
| 12 const size_t kSmallSize = 63; |
| 13 |
| 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; |
| 17 |
| 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; |
| 21 |
| 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; |
| 25 |
| 26 } |
| 27 |
| 28 namespace chromecast { |
| 29 namespace crash_keys { |
| 30 |
| 31 const char kLastApp[] = "last_app"; |
| 32 const char kCurrentApp[] = "current_app"; |
| 33 const char kPreviousApp[] = "previous_app"; |
| 34 |
| 35 size_t RegisterCastCrashKeys() { |
| 36 const base::debug::CrashKey fixed_keys[] = { |
| 37 { kLastApp, kSmallSize }, |
| 38 { kCurrentApp, kSmallSize }, |
| 39 { kPreviousApp, kSmallSize }, |
| 40 // base/: |
| 41 { "dm-usage", kSmallSize }, |
| 42 { "total-dm-usage", kSmallSize }, |
| 43 // content/: |
| 44 { "ppapi_path", kMediumSize }, |
| 45 { "subresource_url", kLargeSize }, |
| 46 }; |
| 47 |
| 48 return base::debug::InitCrashKeys(fixed_keys, arraysize(fixed_keys), |
| 49 kSingleChunkLength); |
| 50 } |
| 51 |
| 52 } // namespace chromecast |
| 53 } // namespace crash_keys |
OLD | NEW |