| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/debug/crash_logging.h" | 5 #include "base/debug/crash_logging.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/debug/stack_trace.h" | 10 #include "base/debug/stack_trace.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 size_t length = 0; | 112 size_t length = 0; |
| 113 | 113 |
| 114 for (size_t i = 0; i < count; ++i) { | 114 for (size_t i = 0; i < count; ++i) { |
| 115 std::string s = base::StringPrintf("%p", addresses[i]); | 115 std::string s = base::StringPrintf("%p", addresses[i]); |
| 116 length += s.length() + 1; | 116 length += s.length() + 1; |
| 117 if (length > kBreakpadValueMax) | 117 if (length > kBreakpadValueMax) |
| 118 break; | 118 break; |
| 119 hex_backtrace.push_back(s); | 119 hex_backtrace.push_back(s); |
| 120 } | 120 } |
| 121 | 121 |
| 122 value = JoinString(hex_backtrace, ' '); | 122 value = base::JoinString(hex_backtrace, " "); |
| 123 | 123 |
| 124 // Warn if this exceeds the breakpad limits. | 124 // Warn if this exceeds the breakpad limits. |
| 125 DCHECK_LE(value.length(), kBreakpadValueMax); | 125 DCHECK_LE(value.length(), kBreakpadValueMax); |
| 126 } | 126 } |
| 127 | 127 |
| 128 SetCrashKeyValue(key, value); | 128 SetCrashKeyValue(key, value); |
| 129 } | 129 } |
| 130 | 130 |
| 131 ScopedCrashKey::ScopedCrashKey(const base::StringPiece& key, | 131 ScopedCrashKey::ScopedCrashKey(const base::StringPiece& key, |
| 132 const base::StringPiece& value) | 132 const base::StringPiece& value) |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 void ResetCrashLoggingForTesting() { | 194 void ResetCrashLoggingForTesting() { |
| 195 delete g_crash_keys_; | 195 delete g_crash_keys_; |
| 196 g_crash_keys_ = NULL; | 196 g_crash_keys_ = NULL; |
| 197 g_chunk_max_length_ = 0; | 197 g_chunk_max_length_ = 0; |
| 198 g_set_key_func_ = NULL; | 198 g_set_key_func_ = NULL; |
| 199 g_clear_key_func_ = NULL; | 199 g_clear_key_func_ = NULL; |
| 200 } | 200 } |
| 201 | 201 |
| 202 } // namespace debug | 202 } // namespace debug |
| 203 } // namespace base | 203 } // namespace base |
| OLD | NEW |