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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8Initializer.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/V8Initializer.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp b/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
index ecf77331c401aa65036fe22541552663439834c7..56544b0c845bf648f40465e29ba189e65a69e525 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
@@ -91,7 +91,7 @@ static Frame* FindFrame(v8::Isolate* isolate,
return V8Location::toImpl(host)->GetFrame();
// This function can handle only those types listed above.
- ASSERT_NOT_REACHED();
+ NOTREACHED();
return 0;
}
@@ -157,7 +157,7 @@ const size_t kWasmWireBytesLimit = 1 << 12;
void V8Initializer::MessageHandlerInMainThread(v8::Local<v8::Message> message,
v8::Local<v8::Value> data) {
- ASSERT(IsMainThread());
+ DCHECK(IsMainThread());
v8::Isolate* isolate = v8::Isolate::GetCurrent();
if (isolate->GetEnteredContext().IsEmpty())
@@ -202,7 +202,7 @@ void V8Initializer::MessageHandlerInMainThread(v8::Local<v8::Message> message,
namespace {
static RejectedPromises& RejectedPromisesOnMainThread() {
- ASSERT(IsMainThread());
+ DCHECK(IsMainThread());
DEFINE_STATIC_LOCAL(RefPtr<RejectedPromises>, rejected_promises,
(RejectedPromises::Create()));
return *rejected_promises;
@@ -222,7 +222,7 @@ static void PromiseRejectHandler(v8::PromiseRejectMessage data,
return;
}
- ASSERT(data.GetEvent() == v8::kPromiseRejectWithNoHandler);
+ DCHECK_EQ(data.GetEvent(), v8::kPromiseRejectWithNoHandler);
v8::Local<v8::Promise> promise = data.GetPromise();
v8::Isolate* isolate = promise->GetIsolate();
@@ -232,7 +232,7 @@ static void PromiseRejectHandler(v8::PromiseRejectMessage data,
if (V8DOMWrapper::IsWrapper(isolate, exception)) {
// Try to get the stack & location from a wrapped exception object (e.g.
// DOMException).
- ASSERT(exception->IsObject());
+ DCHECK(exception->IsObject());
auto private_error = V8PrivateProperty::GetDOMExceptionError(isolate);
v8::Local<v8::Value> error =
private_error.GetOrUndefined(exception.As<v8::Object>());
@@ -267,7 +267,7 @@ static void PromiseRejectHandler(v8::PromiseRejectMessage data,
}
static void PromiseRejectHandlerInMainThread(v8::PromiseRejectMessage data) {
- ASSERT(IsMainThread());
+ DCHECK(IsMainThread());
v8::Local<v8::Promise> promise = data.GetPromise();
@@ -300,10 +300,10 @@ static void PromiseRejectHandlerInWorker(v8::PromiseRejectMessage data) {
if (!execution_context)
return;
- ASSERT(execution_context->IsWorkerGlobalScope());
+ DCHECK(execution_context->IsWorkerGlobalScope());
WorkerOrWorkletScriptController* script_controller =
ToWorkerGlobalScope(execution_context)->ScriptController();
- ASSERT(script_controller);
+ DCHECK(script_controller);
PromiseRejectHandler(data, *script_controller->GetRejectedPromises(),
script_state);
@@ -447,7 +447,7 @@ static void AdjustAmountOfExternalAllocatedMemory(int64_t diff) {
}
void V8Initializer::InitializeMainThread() {
- ASSERT(IsMainThread());
+ DCHECK(IsMainThread());
WTF::ArrayBufferContents::Initialize(AdjustAmountOfExternalAllocatedMemory);
@@ -494,7 +494,7 @@ void V8Initializer::InitializeMainThread() {
profiler->SetGetRetainerInfosCallback(&V8GCController::GetRetainerInfos);
}
- ASSERT(ThreadState::MainThreadState());
+ DCHECK(ThreadState::MainThreadState());
ThreadState::MainThreadState()->RegisterTraceDOMWrappers(
isolate, V8GCController::TraceDOMWrappers,
ScriptWrappableVisitor::InvalidateDeadObjectsInMarkingDeque,

Powered by Google App Engine
This is Rietveld 408576698