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

Unified Diff: base/strings/string_piece.h

Issue 1328333002: Use #if DCHECK_IS_ON() in base/strings/string_piece.* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/strings/string_piece.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/strings/string_piece.h
diff --git a/base/strings/string_piece.h b/base/strings/string_piece.h
index c1af175406c23419f051232e3dcfc1f6f8d7fb83..eb82d336ff1005c1dc0f41d933a7192d7c37e853 100644
--- a/base/strings/string_piece.h
+++ b/base/strings/string_piece.h
@@ -30,6 +30,7 @@
#include "base/base_export.h"
#include "base/basictypes.h"
#include "base/containers/hash_tables.h"
+#include "base/logging.h"
#include "base/strings/string16.h"
namespace base {
@@ -143,7 +144,7 @@ BASE_EXPORT StringPiece16 substr(const StringPiece16& self,
size_t pos,
size_t n);
-#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
+#if DCHECK_IS_ON()
// Asserts that begin <= end to catch some errors with iterator usage.
BASE_EXPORT void AssertIteratorsInOrder(std::string::const_iterator begin,
std::string::const_iterator end);
@@ -189,7 +190,7 @@ template <typename STRING_TYPE> class BasicStringPiece {
: ptr_(offset), length_(len) {}
BasicStringPiece(const typename STRING_TYPE::const_iterator& begin,
const typename STRING_TYPE::const_iterator& end) {
-#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
+#if DCHECK_IS_ON()
// This assertion is done out-of-line to avoid bringing in logging.h and
// instantiating logging macros for every instantiation.
internal::AssertIteratorsInOrder(begin, end);
« no previous file with comments | « no previous file | base/strings/string_piece.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698