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

Unified Diff: third_party/crashpad/crashpad/util/thread/thread_log_messages.cc

Issue 2497833002: support multiple log message handlers in base/logging.h (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « third_party/crashpad/crashpad/util/thread/thread_log_messages.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/crashpad/crashpad/util/thread/thread_log_messages.cc
diff --git a/third_party/crashpad/crashpad/util/thread/thread_log_messages.cc b/third_party/crashpad/crashpad/util/thread/thread_log_messages.cc
index dec111e7fe58e8b334c2fd01dac0a1a40692c01c..44a6b67191bcce27c6a9c8438f40be08b3ed3e70 100644
--- a/third_party/crashpad/crashpad/util/thread/thread_log_messages.cc
+++ b/third_party/crashpad/crashpad/util/thread/thread_log_messages.cc
@@ -41,28 +41,24 @@ class ThreadLogMessagesMaster {
tls_.Initialize(nullptr);
DCHECK(tls_.initialized());
- DCHECK(!logging::GetLogMessageHandler());
- logging::SetLogMessageHandler(LogMessageHandler);
+ logging::AddLogMessageHandler(LogMessageHandler);
}
~ThreadLogMessagesMaster() {
- DCHECK_EQ(logging::GetLogMessageHandler(), &LogMessageHandler);
- logging::SetLogMessageHandler(nullptr);
+ logging::RemoveLogMessageHandler(LogMessageHandler);
tls_.Free();
}
void SetThreadMessageList(std::vector<std::string>* message_list) {
- DCHECK_EQ(logging::GetLogMessageHandler(), &LogMessageHandler);
DCHECK_NE(tls_.Get() != nullptr, message_list != nullptr);
tls_.Set(message_list);
}
private:
static bool LogMessageHandler(logging::LogSeverity severity,
- const char* file_path,
+ const std::string& file_path,
int line,
- size_t message_start,
const std::string& string) {
std::vector<std::string>* log_messages =
reinterpret_cast<std::vector<std::string>*>(tls_.Get());
« no previous file with comments | « third_party/crashpad/crashpad/util/thread/thread_log_messages.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698