OLD | NEW |
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 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <io.h> | 8 #include <io.h> |
9 #include <windows.h> | 9 #include <windows.h> |
10 typedef HANDLE FileHandle; | 10 typedef HANDLE FileHandle; |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 int ctr) | 530 int ctr) |
531 : severity_(severity), file_(file), line_(line) { | 531 : severity_(severity), file_(file), line_(line) { |
532 Init(file, line); | 532 Init(file, line); |
533 } | 533 } |
534 | 534 |
535 LogMessage::LogMessage(const char* file, int line) | 535 LogMessage::LogMessage(const char* file, int line) |
536 : severity_(LOG_INFO), file_(file), line_(line) { | 536 : severity_(LOG_INFO), file_(file), line_(line) { |
537 Init(file, line); | 537 Init(file, line); |
538 } | 538 } |
539 | 539 |
| 540 #if defined(OS_WIN) |
| 541 // Disable warning C4702 ("unreachable code") until we fix crbug.com/380175. |
| 542 // TODO(scottmg|sebmarchand): Remove this pragma once the bug is fixed. |
| 543 #pragma warning(push) |
| 544 #pragma warning(disable: 4702) |
| 545 #endif |
540 LogMessage::LogMessage(const char* file, int line, LogSeverity severity) | 546 LogMessage::LogMessage(const char* file, int line, LogSeverity severity) |
541 : severity_(severity), file_(file), line_(line) { | 547 : severity_(severity), file_(file), line_(line) { |
542 Init(file, line); | 548 Init(file, line); |
543 } | 549 } |
| 550 #if defined(OS_WIN) |
| 551 #pragma warning(pop) |
| 552 #endif |
544 | 553 |
545 LogMessage::LogMessage(const char* file, int line, std::string* result) | 554 LogMessage::LogMessage(const char* file, int line, std::string* result) |
546 : severity_(LOG_FATAL), file_(file), line_(line) { | 555 : severity_(LOG_FATAL), file_(file), line_(line) { |
547 Init(file, line); | 556 Init(file, line); |
548 stream_ << "Check failed: " << *result; | 557 stream_ << "Check failed: " << *result; |
549 delete result; | 558 delete result; |
550 } | 559 } |
551 | 560 |
552 LogMessage::LogMessage(const char* file, int line, LogSeverity severity, | 561 LogMessage::LogMessage(const char* file, int line, LogSeverity severity, |
553 std::string* result) | 562 std::string* result) |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
830 return *log_file_name; | 839 return *log_file_name; |
831 return std::wstring(); | 840 return std::wstring(); |
832 } | 841 } |
833 #endif | 842 #endif |
834 | 843 |
835 } // namespace logging | 844 } // namespace logging |
836 | 845 |
837 std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) { | 846 std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) { |
838 return out << base::WideToUTF8(std::wstring(wstr)); | 847 return out << base::WideToUTF8(std::wstring(wstr)); |
839 } | 848 } |
OLD | NEW |