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

Unified Diff: chrome/common/crash_keys.cc

Issue 12211080: Change crash keys to be registered with a maximum length instead of number of chunks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Win fix Created 7 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
« base/debug/crash_logging.cc ('K') | « chrome/common/DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/crash_keys.cc
diff --git a/chrome/common/crash_keys.cc b/chrome/common/crash_keys.cc
index f5de54b9b468db7c0376771f3d4d4f73033b56c0..7472d4dbd82eea15f9138f53bf886606e0e3b84b 100644
--- a/chrome/common/crash_keys.cc
+++ b/chrome/common/crash_keys.cc
@@ -4,30 +4,62 @@
#include "chrome/common/crash_keys.h"
+#if defined(OS_MACOSX)
+#include "breakpad/src/common/mac/SimpleStringDictionary.h"
+#elif defined(OS_WIN)
+#include "breakpad/src/client/windows/common/ipc_protocol.h"
+#endif
+
namespace crash_keys {
-// TODO(rsesek): This is true on Mac and Linux but not Windows.
-static const size_t kSingleChunkLength = 255;
+// A small crash key, guaranteed to never be split into multiple pieces.
+const size_t kSmallSize = 64;
+
+// 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 sparangly.
Scott Hess - ex-Googler 2013/02/19 23:16:10 Sparingly.
Robert Sesek 2013/02/27 18:52:49 Done.
+const size_t kLargeSize = kSmallSize * 16;
+
+#if defined(OS_MACOSX)
+static const size_t kSingleChunkLength =
+ google_breakpad::KeyValueEntry::MAX_STRING_STORAGE_SIZE;
+#elif defined(OS_WIN)
+static const size_t kSingleChunkLength =
eroman 2013/02/20 00:04:40 There is a bit of a mismatch between what the mean
Robert Sesek 2013/02/27 18:52:49 Done. Same issue on Mac as well.
+ google_breakpad::CustomInfoEntry::kValueMaxLength;
+#else
+static const size_t kSingleChunkLength = 64;
+#endif
+
+// Guarantees for crash key sizes.
+COMPILE_ASSERT(kSmallSize <= kSingleChunkLength,
+ crash_key_chunk_size_too_small);
+#if defined(OS_MACOSX)
+COMPILE_ASSERT(kMediumSize <= kSingleChunkLength,
+ mac_has_medium_size_crash_key_chunks);
+#endif
size_t RegisterChromeCrashKeys() {
base::debug::CrashKey keys[] = {
// TODO(rsesek): Remove when done testing. Needed so arraysize > 0.
- { "rsesek_key", 1 },
+ { "rsesek_key", kSmallSize },
#if defined(OS_MACOSX)
- { mac::kFirstNSException, 1 },
- { mac::kFirstNSExceptionTrace, 1 },
- { mac::kLastNSException, 1 },
- { mac::kLastNSExceptionTrace, 1 },
- { mac::kNSException, 1 },
- { mac::kSendAction, 1 },
- { mac::kZombie, 1 },
- { mac::kZombieTrace, 1 },
+ { mac::kFirstNSException, kMediumSize },
+ { mac::kFirstNSExceptionTrace, kMediumSize },
+ { mac::kLastNSException, kMediumSize },
+ { mac::kLastNSExceptionTrace, kMediumSize },
+ { mac::kNSException, kMediumSize },
+ { mac::kSendAction, kMediumSize },
+ { mac::kZombie, kMediumSize },
+ { mac::kZombieTrace, kMediumSize },
// content/:
- { "channel_error_bt", 1 },
- { "remove_route_bt", 1 },
- { "rwhvm_window", 1 },
+ { "channel_error_bt", kMediumSize },
+ { "remove_route_bt", kMediumSize },
+ { "rwhvm_window", kMediumSize },
// media/:
- { "VideoCaptureDeviceQTKit", 1 },
+ { "VideoCaptureDeviceQTKit", kSmallSize },
#endif
};
« base/debug/crash_logging.cc ('K') | « chrome/common/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698