| Index: base/logging.cc
|
| diff --git a/base/logging.cc b/base/logging.cc
|
| index 0771b47c182e5c18c868f1124a0784bf411d74a9..303d820733e242fd1a65f63f2433e119076700e2 100644
|
| --- a/base/logging.cc
|
| +++ b/base/logging.cc
|
| @@ -53,9 +53,11 @@ typedef pthread_mutex_t* MutexHandle;
|
| #include <ostream>
|
| #include <string>
|
|
|
| +#include "base/auto_reset.h"
|
| #include "base/base_switches.h"
|
| #include "base/command_line.h"
|
| #include "base/debug/alias.h"
|
| +#include "base/debug/crash_logging.h"
|
| #include "base/debug/debugger.h"
|
| #include "base/debug/stack_trace.h"
|
| #include "base/posix/eintr_wrapper.h"
|
| @@ -537,6 +539,22 @@ LogMessage::~LogMessage() {
|
| stream_ << std::endl;
|
| std::string str_newline(stream_.str());
|
|
|
| +// NaCl targets do not have base/debug/crash_logging.cc.
|
| +#if !defined(OS_NACL)
|
| + if (severity_ == LOG_FATAL) {
|
| + // In case of an out-of-memory condition, this code could be reentered when
|
| + // constructing and storing the key. Using a static is not thread-safe, but
|
| + // if multiple threads are in the process of a fatal crash at the same time,
|
| + // this should work.
|
| + static bool guarded = false;
|
| + if (!guarded) {
|
| + base::AutoReset<bool> guard(&guarded, true);
|
| + base::debug::SetCrashKeyValue(
|
| + "LOG_FATAL", base::StringPiece(str_newline.c_str() + message_start_));
|
| + }
|
| + }
|
| +#endif // !defined(OS_NACL)
|
| +
|
| // Give any log message handler first dibs on the message.
|
| if (log_message_handler &&
|
| log_message_handler(severity_, file_, line_,
|
|
|