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

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: Addressed feedback 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, const PathChar* /*new_log_file*/) {
209 if (initialized) 209 if (initialized)
210 return; 210 return;
211 lock_log_file = lock_log; 211 lock_log_file = lock_log;
212 212
213 if (lock_log_file != LOCK_LOG_FILE) 213 if (lock_log_file != LOCK_LOG_FILE)
214 log_lock = new base::internal::LockImpl(); 214 log_lock = new base::internal::LockImpl();
215 215
216 initialized = true; 216 initialized = true;
217 } 217 }
218 218
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 template std::string* MakeCheckOpString<unsigned long, unsigned long>( 448 template std::string* MakeCheckOpString<unsigned long, unsigned long>(
449 const unsigned long&, const unsigned long&, const char* names); 449 const unsigned long&, const unsigned long&, const char* names);
450 template std::string* MakeCheckOpString<unsigned long, unsigned int>( 450 template std::string* MakeCheckOpString<unsigned long, unsigned int>(
451 const unsigned long&, const unsigned int&, const char* names); 451 const unsigned long&, const unsigned int&, const char* names);
452 template std::string* MakeCheckOpString<unsigned int, unsigned long>( 452 template std::string* MakeCheckOpString<unsigned int, unsigned long>(
453 const unsigned int&, const unsigned long&, const char* names); 453 const unsigned int&, const unsigned long&, const char* names);
454 template std::string* MakeCheckOpString<std::string, std::string>( 454 template std::string* MakeCheckOpString<std::string, std::string>(
455 const std::string&, const std::string&, const char* name); 455 const std::string&, const std::string&, const char* name);
456 456
457 template <> 457 template <>
458 void MakeCheckOpValueString(std::ostream* os, const std::nullptr_t& p) { 458 void MakeCheckOpValueString(std::ostream* os, const std::nullptr_t&) {
459 (*os) << "nullptr"; 459 (*os) << "nullptr";
460 } 460 }
461 461
462 #if !defined(NDEBUG) 462 #if !defined(NDEBUG)
463 // Displays a message box to the user with the error message in it. 463 // Displays a message box to the user with the error message in it.
464 // Used for fatal messages, where we close the app simultaneously. 464 // Used for fatal messages, where we close the app simultaneously.
465 // This is for developers only; we don't use this in circumstances 465 // 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 466 // (like release builds) where users could see it, since users don't
467 // understand these messages anyway. 467 // understand these messages anyway.
468 void DisplayDebugMessageInDialog(const std::string& str) { 468 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) { 913 BASE_EXPORT void LogErrorNotReached(const char* file, int line) {
914 LogMessage(file, line, LOG_ERROR).stream() 914 LogMessage(file, line, LOG_ERROR).stream()
915 << "NOTREACHED() hit."; 915 << "NOTREACHED() hit.";
916 } 916 }
917 917
918 } // namespace logging 918 } // namespace logging
919 919
920 std::ostream& std::operator<<(std::ostream& out, const wchar_t* wstr) { 920 std::ostream& std::operator<<(std::ostream& out, const wchar_t* wstr) {
921 return out << (wstr ? base::WideToUTF8(wstr) : std::string()); 921 return out << (wstr ? base::WideToUTF8(wstr) : std::string());
922 } 922 }
OLDNEW
« no previous file with comments | « base/lazy_instance.h ('k') | base/memory/ref_counted.h » ('j') | base/metrics/histogram.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698