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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp

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/V8ScriptRunner.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
index a508c26b2408aba05e39358f4299f7b34c4fb971..6a8c79a380b50bbc992694cf6dd7bfea407a55b5 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
@@ -260,7 +260,7 @@ bool IsResourceHotForCaching(CachedMetadataHandler* cache_handler,
return false;
double time_stamp;
const int size = sizeof(time_stamp);
- ASSERT(cached_metadata->size() == size);
+ DCHECK_EQ(cached_metadata->size(), static_cast<unsigned long>(size));
memcpy(&time_stamp, cached_metadata->Data(), size);
return (WTF::CurrentTime() - time_stamp) < cache_within_seconds;
}
@@ -309,7 +309,7 @@ v8::MaybeLocal<v8::Script> PostStreamCompile(
case kV8CacheOptionsAlways:
// Currently V8CacheOptionsAlways doesn't support streaming.
- ASSERT_NOT_REACHED();
+ NOTREACHED();
case kV8CacheOptionsNone:
break;
}
@@ -389,13 +389,13 @@ static std::unique_ptr<CompileFn> SelectCompileFunction(
case kV8CacheOptionsNone:
// Shouldn't happen, as this is handled above.
// Case is here so that compiler can check all cases are handled.
- ASSERT_NOT_REACHED();
+ NOTREACHED();
break;
}
// All switch branches should return and we should never get here.
// But some compilers aren't sure, hence this default.
- ASSERT_NOT_REACHED();
+ NOTREACHED();
return Bind(CompileWithoutOptions, V8CompileHistogram::kCacheable);
}
@@ -404,11 +404,11 @@ std::unique_ptr<CompileFn> SelectCompileFunction(V8CacheOptions cache_options,
ScriptResource* resource,
ScriptStreamer* streamer) {
// We don't stream scripts which don't have a Resource.
- ASSERT(resource);
+ DCHECK(resource);
// Failed resources should never get this far.
- ASSERT(!resource->ErrorOccurred());
- ASSERT(streamer->IsFinished());
- ASSERT(!streamer->StreamingSuppressed());
+ DCHECK(!resource->ErrorOccurred());
+ DCHECK(streamer->IsFinished());
+ DCHECK(!streamer->StreamingSuppressed());
return WTF::Bind(PostStreamCompile, cache_options,
WrapPersistent(resource->CacheHandler()),
WrapPersistent(streamer));
@@ -466,8 +466,8 @@ v8::MaybeLocal<v8::Script> V8ScriptRunner::CompileScript(
"data",
InspectorCompileScriptEvent::Data(file_name, script_start_position));
- ASSERT(!streamer || resource);
- ASSERT(!resource || resource->CacheHandler() == cache_handler);
+ DCHECK(!streamer || resource);
+ DCHECK(!resource || resource->CacheHandler() == cache_handler);
// NOTE: For compatibility with WebCore, ScriptSourceCode's line starts at
// 1, whereas v8 starts at 0.
@@ -525,7 +525,7 @@ v8::MaybeLocal<v8::Value> V8ScriptRunner::RunCompiledScript(
v8::Isolate* isolate,
v8::Local<v8::Script> script,
ExecutionContext* context) {
- ASSERT(!script.IsEmpty());
+ DCHECK(!script.IsEmpty());
ScopedFrameBlamer frame_blamer(
context->IsDocument() ? ToDocument(context)->GetFrame() : nullptr);
TRACE_EVENT1("v8", "v8.run", "fileName",
@@ -535,7 +535,7 @@ v8::MaybeLocal<v8::Value> V8ScriptRunner::RunCompiledScript(
if (v8::MicrotasksScope::GetCurrentDepth(isolate) >= kMaxRecursionDepth)
return ThrowStackOverflowExceptionIfNeeded(isolate);
- RELEASE_ASSERT(!context->IsIteratingOverObservers());
+ CHECK(!context->IsIteratingOverObservers());
// Run the script and keep track of the current recursion depth.
v8::MaybeLocal<v8::Value> result;
@@ -638,7 +638,7 @@ v8::MaybeLocal<v8::Value> V8ScriptRunner::CallFunction(
return v8::MaybeLocal<v8::Value>(
ThrowStackOverflowExceptionIfNeeded(isolate));
- RELEASE_ASSERT(!context->IsIteratingOverObservers());
+ CHECK(!context->IsIteratingOverObservers());
if (ScriptForbiddenScope::IsScriptForbidden()) {
ThrowScriptForbiddenException(isolate);

Powered by Google App Engine
This is Rietveld 408576698