chore: bump chromium to 92.0.4499.0 (master) (#29046)

This commit is contained in:
Electron Bot 2021-05-06 15:01:04 -07:00 committed by GitHub
parent cbba602eae
commit d5f2eb5a81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
56 changed files with 162 additions and 148 deletions

View file

@ -41,7 +41,8 @@ struct CallbackParamTraits<const T*> {
typedef T* LocalType;
};
// CallbackHolder and CallbackHolderBase are used to pass a base::Callback from
// CallbackHolder and CallbackHolderBase are used to pass a
// base::RepeatingCallback from
// CreateFunctionTemplate through v8 (via v8::FunctionTemplate) to
// DispatchToCallback, where it is invoked.
@ -70,10 +71,10 @@ template <typename Sig>
class CallbackHolder : public CallbackHolderBase {
public:
CallbackHolder(v8::Isolate* isolate,
const base::Callback<Sig>& callback,
const base::RepeatingCallback<Sig>& callback,
int flags)
: CallbackHolderBase(isolate), callback(callback), flags(flags) {}
base::Callback<Sig> callback;
base::RepeatingCallback<Sig> callback;
int flags = 0;
private:
@ -214,7 +215,8 @@ class Invoker<IndicesHolder<indices...>, ArgTypes...>
bool IsOK() { return And(ArgumentHolder<indices, ArgTypes>::ok...); }
template <typename ReturnType>
void DispatchToCallback(base::Callback<ReturnType(ArgTypes...)> callback) {
void DispatchToCallback(
base::RepeatingCallback<ReturnType(ArgTypes...)> callback) {
gin_helper::MicrotasksScope microtasks_scope(args_->isolate(), true);
args_->Return(
callback.Run(std::move(ArgumentHolder<indices, ArgTypes>::value)...));
@ -223,7 +225,7 @@ class Invoker<IndicesHolder<indices...>, ArgTypes...>
// In C++, you can declare the function foo(void), but you can't pass a void
// expression to foo. As a result, we must specialize the case of Callbacks
// that have the void return type.
void DispatchToCallback(base::Callback<void(ArgTypes...)> callback) {
void DispatchToCallback(base::RepeatingCallback<void(ArgTypes...)> callback) {
gin_helper::MicrotasksScope microtasks_scope(args_->isolate(), true);
callback.Run(std::move(ArgumentHolder<indices, ArgTypes>::value)...);
}
@ -239,7 +241,7 @@ class Invoker<IndicesHolder<indices...>, ArgTypes...>
};
// DispatchToCallback converts all the JavaScript arguments to C++ types and
// invokes the base::Callback.
// invokes the base::RepeatingCallback.
template <typename Sig>
struct Dispatcher {};
@ -264,7 +266,8 @@ struct Dispatcher<ReturnType(ArgTypes...)> {
};
// CreateFunctionTemplate creates a v8::FunctionTemplate that will create
// JavaScript functions that execute a provided C++ function or base::Callback.
// JavaScript functions that execute a provided C++ function or
// base::RepeatingCallback.
// JavaScript arguments are automatically converted via gin::Converter, as is
// the return value of the C++ function, if any.
//
@ -275,7 +278,7 @@ struct Dispatcher<ReturnType(ArgTypes...)> {
template <typename Sig>
v8::Local<v8::FunctionTemplate> CreateFunctionTemplate(
v8::Isolate* isolate,
const base::Callback<Sig> callback,
const base::RepeatingCallback<Sig> callback,
int callback_flags = 0) {
typedef CallbackHolder<Sig> HolderT;
HolderT* holder = new HolderT(isolate, callback, callback_flags);
@ -298,9 +301,9 @@ struct CallbackTraits {
}
};
// Specialization for base::Callback.
// Specialization for base::RepeatingCallback.
template <typename T>
struct CallbackTraits<base::Callback<T>> {
struct CallbackTraits<base::RepeatingCallback<T>> {
static v8::Local<v8::FunctionTemplate> CreateTemplate(
v8::Isolate* isolate,
const base::RepeatingCallback<T>& callback) {