refactor: replace v8::Local<T>::Cast() with As<T>() (#29097)

This commit is contained in:
Milan Burda 2021-05-12 09:38:21 +02:00 committed by GitHub
parent e01faedaa5
commit a51aaeb28f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 31 additions and 34 deletions

View file

@ -86,7 +86,7 @@ class RefCountedGlobal
: public base::RefCountedThreadSafe<RefCountedGlobal<T>, DeleteOnUIThread> {
public:
RefCountedGlobal(v8::Isolate* isolate, v8::Local<v8::Value> value)
: handle_(isolate, v8::Local<T>::Cast(value)) {}
: handle_(isolate, value.As<T>()) {}
bool IsAlive() const { return !handle_.IsEmpty(); }
@ -147,8 +147,7 @@ v8::Local<v8::Value> BindFunctionWith(v8::Isolate* isolate,
v8::MaybeLocal<v8::Value> bind =
func->Get(context, gin::StringToV8(isolate, "bind"));
CHECK(!bind.IsEmpty());
v8::Local<v8::Function> bind_func =
v8::Local<v8::Function>::Cast(bind.ToLocalChecked());
v8::Local<v8::Function> bind_func = bind.ToLocalChecked().As<v8::Function>();
v8::Local<v8::Value> converted[] = {func, arg1, arg2};
return bind_func->Call(context, func, base::size(converted), converted)
.ToLocalChecked();