| Index: base/debug/crash_logging.cc
|
| diff --git a/base/debug/crash_logging.cc b/base/debug/crash_logging.cc
|
| index 32b6b05e3967312b729ec4193cb5ef960ad75097..b7b65396410be619039968fe7b41a886431e77e5 100644
|
| --- a/base/debug/crash_logging.cc
|
| +++ b/base/debug/crash_logging.cc
|
| @@ -32,6 +32,8 @@ size_t g_chunk_max_length_ = 0;
|
| // String used to format chunked key names.
|
| const char kChunkFormatString[] = "%s-%" PRIuS;
|
|
|
| +bool g_ignore_unregistered_keys_ = false;
|
| +
|
| // The functions that are called to actually set the key-value pairs in the
|
| // crash reportng system.
|
| SetCrashKeyValueFuncT g_set_key_func_ = NULL;
|
| @@ -56,6 +58,10 @@ void SetCrashKeyValue(const base::StringPiece& key,
|
|
|
| const CrashKey* crash_key = LookupCrashKey(key);
|
|
|
| + if (g_ignore_unregistered_keys_ && !crash_key) {
|
| + return;
|
| + }
|
| +
|
| DCHECK(crash_key) << "All crash keys must be registered before use "
|
| << "(key = " << key << ")";
|
|
|
| @@ -144,7 +150,16 @@ ScopedCrashKey::~ScopedCrashKey() {
|
|
|
| size_t InitCrashKeys(const CrashKey* const keys, size_t count,
|
| size_t chunk_max_length) {
|
| + return InitCrashKeys(keys, count, chunk_max_length,
|
| + false /* ignore_unregistered_keys */);
|
| +}
|
| +
|
| +size_t InitCrashKeys(const CrashKey* const keys,
|
| + size_t count,
|
| + size_t chunk_max_length,
|
| + bool ignore_unregistered_keys) {
|
| DCHECK(!g_crash_keys_) << "Crash logging may only be initialized once";
|
| + g_ignore_unregistered_keys_ = ignore_unregistered_keys;
|
| if (!keys) {
|
| delete g_crash_keys_;
|
| g_crash_keys_ = NULL;
|
| @@ -201,6 +216,7 @@ void ResetCrashLoggingForTesting() {
|
| g_chunk_max_length_ = 0;
|
| g_set_key_func_ = NULL;
|
| g_clear_key_func_ = NULL;
|
| + g_ignore_unregistered_keys_ = false;
|
| }
|
|
|
| } // namespace debug
|
|
|