| 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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 // takes ownership of the returned string. | 462 // takes ownership of the returned string. |
| 463 template<class t1, class t2> | 463 template<class t1, class t2> |
| 464 std::string* MakeCheckOpString(const t1& v1, const t2& v2, const char* names) { | 464 std::string* MakeCheckOpString(const t1& v1, const t2& v2, const char* names) { |
| 465 std::ostringstream ss; | 465 std::ostringstream ss; |
| 466 ss << names << " (" << v1 << " vs. " << v2 << ")"; | 466 ss << names << " (" << v1 << " vs. " << v2 << ")"; |
| 467 std::string* msg = new std::string(ss.str()); | 467 std::string* msg = new std::string(ss.str()); |
| 468 return msg; | 468 return msg; |
| 469 } | 469 } |
| 470 | 470 |
| 471 // MSVC doesn't like complex extern templates and DLLs. | 471 // MSVC doesn't like complex extern templates and DLLs. |
| 472 #if !defined(COMPILER_MSVC) && defined(COMPONENT_BUILD) | 472 #if !defined(COMPILER_MSVC) && defined(BASE_DLL) |
| 473 // Commonly used instantiations of MakeCheckOpString<>. Explicitly instantiated | 473 // Commonly used instantiations of MakeCheckOpString<>. Explicitly instantiated |
| 474 // in logging.cc. | 474 // in logging.cc. |
| 475 extern template std::string* MakeCheckOpString<int, int>( | 475 extern template std::string* MakeCheckOpString<int, int>( |
| 476 const int&, const int&, const char* names); | 476 const int&, const int&, const char* names); |
| 477 extern template std::string* MakeCheckOpString<unsigned long, unsigned long>( | 477 extern template std::string* MakeCheckOpString<unsigned long, unsigned long>( |
| 478 const unsigned long&, const unsigned long&, const char* names); | 478 const unsigned long&, const unsigned long&, const char* names); |
| 479 extern template std::string* MakeCheckOpString<unsigned long, unsigned int>( | 479 extern template std::string* MakeCheckOpString<unsigned long, unsigned int>( |
| 480 const unsigned long&, const unsigned int&, const char* names); | 480 const unsigned long&, const unsigned int&, const char* names); |
| 481 extern template std::string* MakeCheckOpString<unsigned int, unsigned long>( | 481 extern template std::string* MakeCheckOpString<unsigned int, unsigned long>( |
| 482 const unsigned int&, const unsigned long&, const char* names); | 482 const unsigned int&, const unsigned long&, const char* names); |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 943 namespace base { | 943 namespace base { |
| 944 | 944 |
| 945 class StringPiece; | 945 class StringPiece; |
| 946 | 946 |
| 947 // Allows StringPiece to be logged. | 947 // Allows StringPiece to be logged. |
| 948 BASE_API std::ostream& operator<<(std::ostream& o, const StringPiece& piece); | 948 BASE_API std::ostream& operator<<(std::ostream& o, const StringPiece& piece); |
| 949 | 949 |
| 950 } // namespace base | 950 } // namespace base |
| 951 | 951 |
| 952 #endif // BASE_LOGGING_H_ | 952 #endif // BASE_LOGGING_H_ |
| OLD | NEW |