Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef BASE_LOGGING_H_ | 5 #ifndef BASE_LOGGING_H_ |
| 6 #define BASE_LOGGING_H_ | 6 #define BASE_LOGGING_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <cassert> | 9 #include <cassert> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 709 // and the other is NULL. To work around this, simply static_cast NULL to the | 709 // and the other is NULL. To work around this, simply static_cast NULL to the |
| 710 // type of the desired pointer. | 710 // type of the desired pointer. |
| 711 | 711 |
| 712 #define DCHECK_EQ(val1, val2) DCHECK_OP(EQ, ==, val1, val2) | 712 #define DCHECK_EQ(val1, val2) DCHECK_OP(EQ, ==, val1, val2) |
| 713 #define DCHECK_NE(val1, val2) DCHECK_OP(NE, !=, val1, val2) | 713 #define DCHECK_NE(val1, val2) DCHECK_OP(NE, !=, val1, val2) |
| 714 #define DCHECK_LE(val1, val2) DCHECK_OP(LE, <=, val1, val2) | 714 #define DCHECK_LE(val1, val2) DCHECK_OP(LE, <=, val1, val2) |
| 715 #define DCHECK_LT(val1, val2) DCHECK_OP(LT, < , val1, val2) | 715 #define DCHECK_LT(val1, val2) DCHECK_OP(LT, < , val1, val2) |
| 716 #define DCHECK_GE(val1, val2) DCHECK_OP(GE, >=, val1, val2) | 716 #define DCHECK_GE(val1, val2) DCHECK_OP(GE, >=, val1, val2) |
| 717 #define DCHECK_GT(val1, val2) DCHECK_OP(GT, > , val1, val2) | 717 #define DCHECK_GT(val1, val2) DCHECK_OP(GT, > , val1, val2) |
| 718 | 718 |
| 719 #define DCHECK_ALIGNED(ptr) \ | |
|
willchan no longer on Chromium
2011/10/21 16:10:42
I don't think we need to add this into logging.h.
| |
| 720 DCHECK_EQ(reinterpret_cast<uintptr_t>((ptr)) % sizeof((ptr)), 0u) | |
| 721 | |
| 719 #define NOTREACHED() DCHECK(false) | 722 #define NOTREACHED() DCHECK(false) |
| 720 | 723 |
| 721 // Redefine the standard assert to use our nice log files | 724 // Redefine the standard assert to use our nice log files |
| 722 #undef assert | 725 #undef assert |
| 723 #define assert(x) DLOG_ASSERT(x) | 726 #define assert(x) DLOG_ASSERT(x) |
| 724 | 727 |
| 725 // This class more or less represents a particular log message. You | 728 // This class more or less represents a particular log message. You |
| 726 // create an instance of LogMessage and then stream stuff to it. | 729 // create an instance of LogMessage and then stream stuff to it. |
| 727 // When you finish streaming to it, ~LogMessage is called and the | 730 // When you finish streaming to it, ~LogMessage is called and the |
| 728 // full message gets streamed to the appropriate destination. | 731 // full message gets streamed to the appropriate destination. |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 951 namespace base { | 954 namespace base { |
| 952 | 955 |
| 953 class StringPiece; | 956 class StringPiece; |
| 954 | 957 |
| 955 // Allows StringPiece to be logged. | 958 // Allows StringPiece to be logged. |
| 956 BASE_EXPORT std::ostream& operator<<(std::ostream& o, const StringPiece& piece); | 959 BASE_EXPORT std::ostream& operator<<(std::ostream& o, const StringPiece& piece); |
| 957 | 960 |
| 958 } // namespace base | 961 } // namespace base |
| 959 | 962 |
| 960 #endif // BASE_LOGGING_H_ | 963 #endif // BASE_LOGGING_H_ |
| OLD | NEW |