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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8StringResource.h

Issue 2817533003: Replace ASSERT, RELEASE_ASSERT, and ASSERT_NOT_REACHED in bindings (Closed)
Patch Set: fixed dcheck build error Created 3 years, 8 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
Index: third_party/WebKit/Source/bindings/core/v8/V8StringResource.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8StringResource.h b/third_party/WebKit/Source/bindings/core/v8/V8StringResource.h
index dceff6f31bc2d96a8731a4b69a6293ed1eee3321..847bf7619b6bb404ab452f8d6e7c57d8e0ede677 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8StringResource.h
+++ b/third_party/WebKit/Source/bindings/core/v8/V8StringResource.h
@@ -47,7 +47,7 @@ class WebCoreStringResourceBase {
#if DCHECK_IS_ON()
thread_id_ = WTF::CurrentThread();
#endif
- ASSERT(!string.IsNull());
+ DCHECK(!string.IsNull());
v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(
string.CharactersSizeInBytes());
}
@@ -57,14 +57,14 @@ class WebCoreStringResourceBase {
#if DCHECK_IS_ON()
thread_id_ = WTF::CurrentThread();
#endif
- ASSERT(!string.IsNull());
+ DCHECK(!string.IsNull());
v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(
string.CharactersSizeInBytes());
}
virtual ~WebCoreStringResourceBase() {
#if DCHECK_IS_ON()
- ASSERT(thread_id_ == WTF::CurrentThread());
+ DCHECK_EQ(thread_id_, WTF::CurrentThread());
#endif
int64_t reduced_external_memory = plain_string_.CharactersSizeInBytes();
if (plain_string_.Impl() != atomic_string_.Impl() &&
@@ -78,11 +78,11 @@ class WebCoreStringResourceBase {
const AtomicString& GetAtomicString() {
#if DCHECK_IS_ON()
- ASSERT(thread_id_ == WTF::CurrentThread());
+ DCHECK_EQ(thread_id_, WTF::CurrentThread());
#endif
if (atomic_string_.IsNull()) {
atomic_string_ = AtomicString(plain_string_);
- ASSERT(!atomic_string_.IsNull());
+ DCHECK(!atomic_string_.IsNull());
if (plain_string_.Impl() != atomic_string_.Impl())
v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(
atomic_string_.CharactersSizeInBytes());
@@ -115,12 +115,12 @@ class WebCoreStringResource16 final
public:
explicit WebCoreStringResource16(const String& string)
: WebCoreStringResourceBase(string) {
- ASSERT(!string.Is8Bit());
+ DCHECK(!string.Is8Bit());
}
explicit WebCoreStringResource16(const AtomicString& string)
: WebCoreStringResourceBase(string) {
- ASSERT(!string.Is8Bit());
+ DCHECK(!string.Is8Bit());
}
size_t length() const override { return plain_string_.Impl()->length(); }
@@ -138,12 +138,12 @@ class WebCoreStringResource8 final
public:
explicit WebCoreStringResource8(const String& string)
: WebCoreStringResourceBase(string) {
- ASSERT(string.Is8Bit());
+ DCHECK(string.Is8Bit());
}
explicit WebCoreStringResource8(const AtomicString& string)
: WebCoreStringResourceBase(string) {
- ASSERT(string.Is8Bit());
+ DCHECK(string.Is8Bit());
}
size_t length() const override { return plain_string_.Impl()->length(); }
@@ -269,7 +269,7 @@ inline bool V8StringResource<kDefaultMode>::IsValid() const {
template <>
inline String V8StringResource<kDefaultMode>::FallbackString() const {
- ASSERT_NOT_REACHED();
+ NOTREACHED();
return String();
}

Powered by Google App Engine
This is Rietveld 408576698