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( ...@@ -589,7 +589,7 @@ void V8Console::cancelAsyncTask(
void V8Console::scheduleTask(const v8::FunctionCallbackInfo<v8::Value>& info) { void V8Console::scheduleTask(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate(); v8::Isolate* isolate = info.GetIsolate();
if (info.Length() < 1 || !info[0]->IsString() || 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."); isolate->ThrowError("First argument must be a non-empty string.");
return; return;
} }
...@@ -607,8 +607,7 @@ void V8Console::scheduleTask(const v8::FunctionCallbackInfo<v8::Value>& info) { ...@@ -607,8 +607,7 @@ void V8Console::scheduleTask(const v8::FunctionCallbackInfo<v8::Value>& info) {
auto [iter, inserted] = m_tasks.emplace(taskId, std::move(taskInfo)); auto [iter, inserted] = m_tasks.emplace(taskId, std::move(taskInfo));
CHECK(inserted); CHECK(inserted);
String16 nameArgument = String16 nameArgument = toProtocolString(isolate, info[0].As<v8::String>());
toProtocolString(isolate, v8::Local<v8::String>::Cast(info[0]));
StringView taskName = StringView taskName =
StringView(nameArgument.characters16(), nameArgument.length()); StringView(nameArgument.characters16(), nameArgument.length());
m_inspector->asyncTaskScheduled(taskName, taskId, /* recurring */ true); m_inspector->asyncTaskScheduled(taskName, taskId, /* recurring */ true);
...@@ -637,8 +636,7 @@ void V8Console::runTask(const v8::FunctionCallbackInfo<v8::Value>& info) { ...@@ -637,8 +636,7 @@ void V8Console::runTask(const v8::FunctionCallbackInfo<v8::Value>& info) {
return; return;
} }
v8::Local<v8::External> taskExternal = v8::Local<v8::External> taskExternal = maybeTaskExternal.As<v8::External>();
v8::Local<v8::External>::Cast(maybeTaskExternal);
TaskInfo* taskInfo = reinterpret_cast<TaskInfo*>(taskExternal->Value()); TaskInfo* taskInfo = reinterpret_cast<TaskInfo*>(taskExternal->Value());
m_inspector->asyncTaskStarted(taskInfo->Id()); 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