| 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 #ifndef BASE_LOGGING_H_ | 5 #ifndef BASE_LOGGING_H_ |
| 6 #define BASE_LOGGING_H_ | 6 #define BASE_LOGGING_H_ |
| 7 | 7 |
| 8 #include <cassert> | 8 #include <cassert> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <cstring> | 10 #include <cstring> |
| (...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 // type of the desired pointer. | 694 // type of the desired pointer. |
| 695 | 695 |
| 696 #define DCHECK_EQ(val1, val2) DCHECK_OP(EQ, ==, val1, val2) | 696 #define DCHECK_EQ(val1, val2) DCHECK_OP(EQ, ==, val1, val2) |
| 697 #define DCHECK_NE(val1, val2) DCHECK_OP(NE, !=, val1, val2) | 697 #define DCHECK_NE(val1, val2) DCHECK_OP(NE, !=, val1, val2) |
| 698 #define DCHECK_LE(val1, val2) DCHECK_OP(LE, <=, val1, val2) | 698 #define DCHECK_LE(val1, val2) DCHECK_OP(LE, <=, val1, val2) |
| 699 #define DCHECK_LT(val1, val2) DCHECK_OP(LT, < , val1, val2) | 699 #define DCHECK_LT(val1, val2) DCHECK_OP(LT, < , val1, val2) |
| 700 #define DCHECK_GE(val1, val2) DCHECK_OP(GE, >=, val1, val2) | 700 #define DCHECK_GE(val1, val2) DCHECK_OP(GE, >=, val1, val2) |
| 701 #define DCHECK_GT(val1, val2) DCHECK_OP(GT, > , val1, val2) | 701 #define DCHECK_GT(val1, val2) DCHECK_OP(GT, > , val1, val2) |
| 702 #define DCHECK_IMPLIES(val1, val2) DCHECK(!(val1) || (val2)) | 702 #define DCHECK_IMPLIES(val1, val2) DCHECK(!(val1) || (val2)) |
| 703 | 703 |
| 704 #if defined(NDEBUG) && defined(OS_CHROMEOS) | 704 #if !DCHECK_IS_ON && defined(OS_CHROMEOS) |
| 705 #define NOTREACHED() LOG(ERROR) << "NOTREACHED() hit in " << \ | 705 #define NOTREACHED() LOG(ERROR) << "NOTREACHED() hit in " << \ |
| 706 __FUNCTION__ << ". " | 706 __FUNCTION__ << ". " |
| 707 #else | 707 #else |
| 708 #define NOTREACHED() DCHECK(false) | 708 #define NOTREACHED() DCHECK(false) |
| 709 #endif | 709 #endif |
| 710 | 710 |
| 711 // Redefine the standard assert to use our nice log files | 711 // Redefine the standard assert to use our nice log files |
| 712 #undef assert | 712 #undef assert |
| 713 #define assert(x) DLOG_ASSERT(x) | 713 #define assert(x) DLOG_ASSERT(x) |
| 714 | 714 |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 928 #elif NOTIMPLEMENTED_POLICY == 5 | 928 #elif NOTIMPLEMENTED_POLICY == 5 |
| 929 #define NOTIMPLEMENTED() do {\ | 929 #define NOTIMPLEMENTED() do {\ |
| 930 static bool logged_once = false;\ | 930 static bool logged_once = false;\ |
| 931 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\ | 931 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\ |
| 932 logged_once = true;\ | 932 logged_once = true;\ |
| 933 } while(0);\ | 933 } while(0);\ |
| 934 EAT_STREAM_PARAMETERS | 934 EAT_STREAM_PARAMETERS |
| 935 #endif | 935 #endif |
| 936 | 936 |
| 937 #endif // BASE_LOGGING_H_ | 937 #endif // BASE_LOGGING_H_ |
| OLD | NEW |