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

Side by Side Diff: base/logging.cc

Issue 1997153002: libchrome: Several upstreamable fixes from libchrome Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: Also fix unit tests Created 4 years, 7 months 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 (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/logging.h" 5 #include "base/logging.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 class LoggingLock { 198 class LoggingLock {
199 public: 199 public:
200 LoggingLock() { 200 LoggingLock() {
201 LockLogging(); 201 LockLogging();
202 } 202 }
203 203
204 ~LoggingLock() { 204 ~LoggingLock() {
205 UnlockLogging(); 205 UnlockLogging();
206 } 206 }
207 207
208 static void Init(LogLockingState lock_log, const PathChar* new_log_file) { 208 static void Init(LogLockingState lock_log,
209 const PathChar* /* new_log_file */) {
209 if (initialized) 210 if (initialized)
210 return; 211 return;
211 lock_log_file = lock_log; 212 lock_log_file = lock_log;
212 213
213 if (lock_log_file != LOCK_LOG_FILE) 214 if (lock_log_file != LOCK_LOG_FILE)
214 log_lock = new base::internal::LockImpl(); 215 log_lock = new base::internal::LockImpl();
215 216
216 initialized = true; 217 initialized = true;
217 } 218 }
218 219
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 template std::string* MakeCheckOpString<unsigned long, unsigned long>( 449 template std::string* MakeCheckOpString<unsigned long, unsigned long>(
449 const unsigned long&, const unsigned long&, const char* names); 450 const unsigned long&, const unsigned long&, const char* names);
450 template std::string* MakeCheckOpString<unsigned long, unsigned int>( 451 template std::string* MakeCheckOpString<unsigned long, unsigned int>(
451 const unsigned long&, const unsigned int&, const char* names); 452 const unsigned long&, const unsigned int&, const char* names);
452 template std::string* MakeCheckOpString<unsigned int, unsigned long>( 453 template std::string* MakeCheckOpString<unsigned int, unsigned long>(
453 const unsigned int&, const unsigned long&, const char* names); 454 const unsigned int&, const unsigned long&, const char* names);
454 template std::string* MakeCheckOpString<std::string, std::string>( 455 template std::string* MakeCheckOpString<std::string, std::string>(
455 const std::string&, const std::string&, const char* name); 456 const std::string&, const std::string&, const char* name);
456 457
457 template <> 458 template <>
458 void MakeCheckOpValueString(std::ostream* os, const std::nullptr_t& p) { 459 void MakeCheckOpValueString(std::ostream* os, const std::nullptr_t& /* p */) {
danakj 2016/05/23 02:59:54 delete the name, it adds nothing
Luis Héctor Chávez 2016/05/24 15:27:53 Done.
459 (*os) << "nullptr"; 460 (*os) << "nullptr";
460 } 461 }
461 462
462 #if !defined(NDEBUG) 463 #if !defined(NDEBUG)
463 // Displays a message box to the user with the error message in it. 464 // Displays a message box to the user with the error message in it.
464 // Used for fatal messages, where we close the app simultaneously. 465 // Used for fatal messages, where we close the app simultaneously.
465 // This is for developers only; we don't use this in circumstances 466 // This is for developers only; we don't use this in circumstances
466 // (like release builds) where users could see it, since users don't 467 // (like release builds) where users could see it, since users don't
467 // understand these messages anyway. 468 // understand these messages anyway.
468 void DisplayDebugMessageInDialog(const std::string& str) { 469 void DisplayDebugMessageInDialog(const std::string& str) {
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 BASE_EXPORT void LogErrorNotReached(const char* file, int line) { 914 BASE_EXPORT void LogErrorNotReached(const char* file, int line) {
914 LogMessage(file, line, LOG_ERROR).stream() 915 LogMessage(file, line, LOG_ERROR).stream()
915 << "NOTREACHED() hit."; 916 << "NOTREACHED() hit.";
916 } 917 }
917 918
918 } // namespace logging 919 } // namespace logging
919 920
920 std::ostream& std::operator<<(std::ostream& out, const wchar_t* wstr) { 921 std::ostream& std::operator<<(std::ostream& out, const wchar_t* wstr) {
921 return out << (wstr ? base::WideToUTF8(wstr) : std::string()); 922 return out << (wstr ? base::WideToUTF8(wstr) : std::string());
922 } 923 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698