Commit b838f9de authored by Simon Zünd's avatar Simon Zünd Committed by V8 LUCI CQ

[inspector] Replace 'Cast' with 'As' in async stack tagging

Minor cleanup CL for better readability.

R=kimanh@chromium.org

Bug: chromium:1334585
Change-Id: I430a33e2b7173e146ff9927e70b06a04770cd956
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3779495Reviewed-by: 's avatarKim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Auto-Submit: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81905}
parent 8aca0dcd
......@@ -589,7 +589,7 @@ void V8Console::cancelAsyncTask(
void V8Console::scheduleTask(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
if (info.Length() < 1 || !info[0]->IsString() ||
!v8::Local<v8::String>::Cast(info[0])->Length()) {
!info[0].As<v8::String>()->Length()) {
isolate->ThrowError("First argument must be a non-empty string.");
return;
}
......@@ -607,8 +607,7 @@ void V8Console::scheduleTask(const v8::FunctionCallbackInfo<v8::Value>& info) {
auto [iter, inserted] = m_tasks.emplace(taskId, std::move(taskInfo));
CHECK(inserted);
String16 nameArgument =
toProtocolString(isolate, v8::Local<v8::String>::Cast(info[0]));
String16 nameArgument = toProtocolString(isolate, info[0].As<v8::String>());
StringView taskName =
StringView(nameArgument.characters16(), nameArgument.length());
m_inspector->asyncTaskScheduled(taskName, taskId, /* recurring */ true);
......@@ -637,8 +636,7 @@ void V8Console::runTask(const v8::FunctionCallbackInfo<v8::Value>& info) {
return;
}
v8::Local<v8::External> taskExternal =
v8::Local<v8::External>::Cast(maybeTaskExternal);
v8::Local<v8::External> taskExternal = maybeTaskExternal.As<v8::External>();
TaskInfo* taskInfo = reinterpret_cast<TaskInfo*>(taskExternal->Value());
m_inspector->asyncTaskStarted(taskInfo->Id());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment