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

Side by Side Diff: base/logging.cc

Issue 2807463004: GN: aix port along with linux_s390x, linux_ppc64 and linux_ppc64le support. (Closed)
Patch Set: rebased, cleaned up the code, addressed comments Created 3 years, 8 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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 LogMessage::LogMessage(const char* file, int line, LogSeverity severity, 538 LogMessage::LogMessage(const char* file, int line, LogSeverity severity,
539 std::string* result) 539 std::string* result)
540 : severity_(severity), file_(file), line_(line) { 540 : severity_(severity), file_(file), line_(line) {
541 Init(file, line); 541 Init(file, line);
542 stream_ << "Check failed: " << *result; 542 stream_ << "Check failed: " << *result;
543 delete result; 543 delete result;
544 } 544 }
545 545
546 LogMessage::~LogMessage() { 546 LogMessage::~LogMessage() {
547 size_t stack_start = stream_.tellp(); 547 size_t stack_start = stream_.tellp();
548 #if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) 548 #if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
549 !defined(OS_AIX)
549 if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) { 550 if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
550 // Include a stack trace on a fatal, unless a debugger is attached. 551 // Include a stack trace on a fatal, unless a debugger is attached.
551 base::debug::StackTrace trace; 552 base::debug::StackTrace trace;
552 stream_ << std::endl; // Newline to separate from log message. 553 stream_ << std::endl; // Newline to separate from log message.
553 trace.OutputToStream(&stream_); 554 trace.OutputToStream(&stream_);
554 } 555 }
555 #endif 556 #endif
556 stream_ << std::endl; 557 stream_ << std::endl;
557 std::string str_newline(stream_.str()); 558 std::string str_newline(stream_.str());
558 559
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
970 BASE_EXPORT void LogErrorNotReached(const char* file, int line) { 971 BASE_EXPORT void LogErrorNotReached(const char* file, int line) {
971 LogMessage(file, line, LOG_ERROR).stream() 972 LogMessage(file, line, LOG_ERROR).stream()
972 << "NOTREACHED() hit."; 973 << "NOTREACHED() hit.";
973 } 974 }
974 975
975 } // namespace logging 976 } // namespace logging
976 977
977 std::ostream& std::operator<<(std::ostream& out, const wchar_t* wstr) { 978 std::ostream& std::operator<<(std::ostream& out, const wchar_t* wstr) {
978 return out << (wstr ? base::WideToUTF8(wstr) : std::string()); 979 return out << (wstr ? base::WideToUTF8(wstr) : std::string());
979 } 980 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698