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

Side by Side Diff: third_party/crashpad/crashpad/util/thread/thread_log_messages.cc

Issue 2478633002: Update Crashpad to b47bf6c250c6b825dee1c5fbad9152c2c962e828 (Closed)
Patch Set: mac comment 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Crashpad Authors. All rights reserved. 1 // Copyright 2015 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 28 matching lines...) Expand all
39 ThreadLogMessagesMaster() { 39 ThreadLogMessagesMaster() {
40 DCHECK(!tls_.initialized()); 40 DCHECK(!tls_.initialized());
41 tls_.Initialize(nullptr); 41 tls_.Initialize(nullptr);
42 DCHECK(tls_.initialized()); 42 DCHECK(tls_.initialized());
43 43
44 DCHECK(!logging::GetLogMessageHandler()); 44 DCHECK(!logging::GetLogMessageHandler());
45 logging::SetLogMessageHandler(LogMessageHandler); 45 logging::SetLogMessageHandler(LogMessageHandler);
46 } 46 }
47 47
48 ~ThreadLogMessagesMaster() { 48 ~ThreadLogMessagesMaster() {
49 DCHECK_EQ(logging::GetLogMessageHandler(), LogMessageHandler); 49 DCHECK_EQ(logging::GetLogMessageHandler(), &LogMessageHandler);
50 logging::SetLogMessageHandler(nullptr); 50 logging::SetLogMessageHandler(nullptr);
51 51
52 tls_.Free(); 52 tls_.Free();
53 } 53 }
54 54
55 void SetThreadMessageList(std::vector<std::string>* message_list) { 55 void SetThreadMessageList(std::vector<std::string>* message_list) {
56 DCHECK_EQ(logging::GetLogMessageHandler(), LogMessageHandler); 56 DCHECK_EQ(logging::GetLogMessageHandler(), &LogMessageHandler);
57 DCHECK_NE(tls_.Get() != nullptr, message_list != nullptr); 57 DCHECK_NE(tls_.Get() != nullptr, message_list != nullptr);
58 tls_.Set(message_list); 58 tls_.Set(message_list);
59 } 59 }
60 60
61 private: 61 private:
62 static bool LogMessageHandler(logging::LogSeverity severity, 62 static bool LogMessageHandler(logging::LogSeverity severity,
63 const char* file_path, 63 const char* file_path,
64 int line, 64 int line,
65 size_t message_start, 65 size_t message_start,
66 const std::string& string) { 66 const std::string& string) {
(...skipping 25 matching lines...) Expand all
92 ThreadLogMessages::ThreadLogMessages() 92 ThreadLogMessages::ThreadLogMessages()
93 : log_messages_() { 93 : log_messages_() {
94 g_master.Get().SetThreadMessageList(&log_messages_); 94 g_master.Get().SetThreadMessageList(&log_messages_);
95 } 95 }
96 96
97 ThreadLogMessages::~ThreadLogMessages() { 97 ThreadLogMessages::~ThreadLogMessages() {
98 g_master.Get().SetThreadMessageList(nullptr); 98 g_master.Get().SetThreadMessageList(nullptr);
99 } 99 }
100 100
101 } // namespace crashpad 101 } // namespace crashpad
OLDNEW
« no previous file with comments | « third_party/crashpad/crashpad/util/string/split_string_test.cc ('k') | third_party/crashpad/crashpad/util/util.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698