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

@ -117,7 +117,7 @@ class BrowserWindow : public BaseWindow,
// Closure that would be called when window is unresponsive when closing,
// it should be cancelled when we can prove that the window is responsive.
base::CancelableClosure window_unresponsive_closure_;
base::CancelableRepeatingClosure window_unresponsive_closure_;
#if defined(OS_MAC)
std::vector<mojom::DraggableRegionPtr> draggable_regions_;

View file

@ -73,7 +73,7 @@ void GlobalShortcut::OnKeyPressed(const ui::Accelerator& accelerator) {
bool GlobalShortcut::RegisterAll(
const std::vector<ui::Accelerator>& accelerators,
const base::Closure& callback) {
const base::RepeatingClosure& callback) {
if (!electron::Browser::Get()->is_ready()) {
gin_helper::ErrorThrower(JavascriptEnvironment::GetIsolate())
.ThrowError("globalShortcut cannot be used before the app is ready");
@ -94,7 +94,7 @@ bool GlobalShortcut::RegisterAll(
}
bool GlobalShortcut::Register(const ui::Accelerator& accelerator,
const base::Closure& callback) {
const base::RepeatingClosure& callback) {
if (!electron::Browser::Get()->is_ready()) {
gin_helper::ErrorThrower(JavascriptEnvironment::GetIsolate())
.ThrowError("globalShortcut cannot be used before the app is ready");

View file

@ -35,12 +35,13 @@ class GlobalShortcut : public extensions::GlobalShortcutListener::Observer,
~GlobalShortcut() override;
private:
typedef std::map<ui::Accelerator, base::Closure> AcceleratorCallbackMap;
typedef std::map<ui::Accelerator, base::RepeatingClosure>
AcceleratorCallbackMap;
bool RegisterAll(const std::vector<ui::Accelerator>& accelerators,
const base::Closure& callback);
const base::RepeatingClosure& callback);
bool Register(const ui::Accelerator& accelerator,
const base::Closure& callback);
const base::RepeatingClosure& callback);
bool IsRegistered(const ui::Accelerator& accelerator);
void Unregister(const ui::Accelerator& accelerator);
void UnregisterSome(const std::vector<ui::Accelerator>& accelerators);

View file

@ -155,7 +155,7 @@ class Browser : public WindowListObserver {
#if defined(OS_MAC)
// Set the handler which decides whether to shutdown.
void SetShutdownHandler(base::Callback<bool()> handler);
void SetShutdownHandler(base::RepeatingCallback<bool()> handler);
// Hide the application.
void Hide();

View file

@ -93,7 +93,7 @@ v8::Local<v8::Promise> Browser::GetApplicationInfoForProtocol(
return handle;
}
void Browser::SetShutdownHandler(base::Callback<bool()> handler) {
void Browser::SetShutdownHandler(base::RepeatingCallback<bool()> handler) {
[[AtomApplication sharedApplication] setShutdownHandler:std::move(handler)];
}

View file

@ -26,7 +26,8 @@ CookieChangeNotifier::~CookieChangeNotifier() = default;
base::CallbackListSubscription
CookieChangeNotifier::RegisterCookieChangeCallback(
const base::Callback<void(const net::CookieChangeInfo& change)>& cb) {
const base::RepeatingCallback<void(const net::CookieChangeInfo& change)>&
cb) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
return cookie_change_sub_list_.Add(cb);

View file

@ -25,7 +25,8 @@ class CookieChangeNotifier : public network::mojom::CookieChangeListener {
// Register callbacks that needs to notified on any cookie store changes.
base::CallbackListSubscription RegisterCookieChangeCallback(
const base::Callback<void(const net::CookieChangeInfo& change)>& cb);
const base::RepeatingCallback<void(const net::CookieChangeInfo& change)>&
cb);
private:
void StartListening();

View file

@ -22,7 +22,7 @@ class ElectronDownloadManagerDelegate
: public content::DownloadManagerDelegate {
public:
using CreateDownloadPathCallback =
base::Callback<void(const base::FilePath&)>;
base::RepeatingCallback<void(const base::FilePath&)>;
explicit ElectronDownloadManagerDelegate(content::DownloadManager* manager);
~ElectronDownloadManagerDelegate() override;

View file

@ -29,14 +29,15 @@ class ElectronPermissionManager : public content::PermissionControllerDelegate {
base::OnceCallback<void(blink::mojom::PermissionStatus)>;
using StatusesCallback = base::OnceCallback<void(
const std::vector<blink::mojom::PermissionStatus>&)>;
using RequestHandler = base::Callback<void(content::WebContents*,
content::PermissionType,
StatusCallback,
const base::Value&)>;
using CheckHandler = base::Callback<bool(content::WebContents*,
content::PermissionType,
const GURL& requesting_origin,
const base::Value&)>;
using RequestHandler = base::RepeatingCallback<void(content::WebContents*,
content::PermissionType,
StatusCallback,
const base::Value&)>;
using CheckHandler =
base::RepeatingCallback<bool(content::WebContents*,
content::PermissionType,
const GURL& requesting_origin,
const base::Value&)>;
// Handler to dispatch permission requests in JS.
void SetPermissionRequestHandler(const RequestHandler& handler);

View file

@ -115,7 +115,8 @@ void PowerObserverLinux::UnblockShutdown() {
shutdown_lock_.reset();
}
void PowerObserverLinux::SetShutdownHandler(base::Callback<bool()> handler) {
void PowerObserverLinux::SetShutdownHandler(
base::RepeatingCallback<bool()> handler) {
// In order to delay system shutdown when e.preventDefault() is invoked
// on a powerMonitor 'shutdown' event, we need an org.freedesktop.login1
// shutdown delay lock. For more details see the "Taking Delay Locks"

View file

@ -22,7 +22,7 @@ class PowerObserverLinux {
explicit PowerObserverLinux(base::PowerSuspendObserver* suspend_observer);
~PowerObserverLinux();
void SetShutdownHandler(base::Callback<bool()> should_shutdown);
void SetShutdownHandler(base::RepeatingCallback<bool()> should_shutdown);
private:
void BlockSleep();

View file

@ -18,12 +18,12 @@
NSCondition* handoffLock_;
BOOL updateReceived_;
BOOL userStoppedShutdown_;
base::Callback<bool()> shouldShutdown_;
base::RepeatingCallback<bool()> shouldShutdown_;
}
+ (AtomApplication*)sharedApplication;
- (void)setShutdownHandler:(base::Callback<bool()>)handler;
- (void)setShutdownHandler:(base::RepeatingCallback<bool()>)handler;
- (void)registerURLHandler;
// Called when macOS itself is shutting down.

View file

@ -56,7 +56,7 @@ inline void dispatch_sync_main(dispatch_block_t block) {
electron::Browser::Get()->Quit();
}
- (void)setShutdownHandler:(base::Callback<bool()>)handler {
- (void)setShutdownHandler:(base::RepeatingCallback<bool()>)handler {
shouldShutdown_ = std::move(handler);
}

View file

@ -33,7 +33,8 @@ enum class ProtocolType {
using StartLoadingCallback = base::OnceCallback<void(gin::Arguments*)>;
using ProtocolHandler =
base::Callback<void(const network::ResourceRequest&, StartLoadingCallback)>;
base::RepeatingCallback<void(const network::ResourceRequest&,
StartLoadingCallback)>;
// scheme => (type, handler).
using HandlersMap =

View file

@ -17,7 +17,8 @@
namespace electron {
typedef base::Callback<void(const gfx::Rect&, const SkBitmap&)> OnPaintCallback;
typedef base::RepeatingCallback<void(const gfx::Rect&, const SkBitmap&)>
OnPaintCallback;
class LayeredWindowUpdater : public viz::mojom::LayeredWindowUpdater {
public:

View file

@ -52,8 +52,9 @@ class ElectronBeginFrameTimer;
class ElectronDelegatedFrameHostClient;
typedef base::Callback<void(const gfx::Rect&, const SkBitmap&)> OnPaintCallback;
typedef base::Callback<void(const gfx::Rect&)> OnPopupPaintCallback;
typedef base::RepeatingCallback<void(const gfx::Rect&, const SkBitmap&)>
OnPaintCallback;
typedef base::RepeatingCallback<void(const gfx::Rect&)> OnPopupPaintCallback;
class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase,
public ui::CompositorDelegate,

View file

@ -37,7 +37,7 @@ AppIndicatorIconMenu::~AppIndicatorIconMenu() {
void AppIndicatorIconMenu::UpdateClickActionReplacementMenuItem(
const char* label,
const base::Closure& callback) {
const base::RepeatingClosure& callback) {
click_action_replacement_callback_ = callback;
if (click_action_replacement_menu_item_added_) {

View file

@ -29,8 +29,9 @@ class AppIndicatorIconMenu {
// Sets a menu item at the top of |gtk_menu_| as a replacement for the app
// indicator icon's click action. |callback| is called when the menu item
// is activated.
void UpdateClickActionReplacementMenuItem(const char* label,
const base::Closure& callback);
void UpdateClickActionReplacementMenuItem(
const char* label,
const base::RepeatingClosure& callback);
// Refreshes all the menu item labels and menu item checked/enabled states.
void Refresh();
@ -59,7 +60,7 @@ class AppIndicatorIconMenu {
// Called when the click action replacement menu item is activated. When a
// menu item from |menu_model_| is activated, MenuModel::ActivatedAt() is
// invoked and is assumed to do any necessary processing.
base::Closure click_action_replacement_callback_;
base::RepeatingClosure click_action_replacement_callback_;
GtkWidget* gtk_menu_ = nullptr;

View file

@ -25,7 +25,7 @@ class TaskbarHost {
std::string tooltip;
gfx::Image icon;
std::vector<std::string> flags;
base::Closure clicked_callback;
base::RepeatingClosure clicked_callback;
ThumbarButton();
ThumbarButton(const ThumbarButton&);
@ -66,7 +66,7 @@ class TaskbarHost {
// Initialize the taskbar object.
bool InitializeTaskbar();
using CallbackMap = std::map<int, base::Closure>;
using CallbackMap = std::map<int, base::RepeatingClosure>;
CallbackMap callback_map_;
std::vector<ThumbarButton> last_buttons_;

View file

@ -14,7 +14,7 @@
#include "shell/common/gin_helper/function_template.h"
#include "shell/common/gin_helper/locker.h"
#include "shell/common/gin_helper/microtasks_scope.h"
// Implements safe convertions between JS functions and base::Callback.
// Implements safe convertions between JS functions and base::RepeatingCallback.
namespace gin_helper {
@ -111,7 +111,7 @@ struct V8FunctionInvoker<ReturnType(ArgTypes...)> {
};
// Helper to pass a C++ funtion to JavaScript.
using Translater = base::Callback<void(gin::Arguments* args)>;
using Translater = base::RepeatingCallback<void(gin::Arguments* args)>;
v8::Local<v8::Value> CreateFunctionFromTranslater(v8::Isolate* isolate,
const Translater& translater,
bool one_time);
@ -127,7 +127,7 @@ struct NativeFunctionInvoker {};
template <typename ReturnType, typename... ArgTypes>
struct NativeFunctionInvoker<ReturnType(ArgTypes...)> {
static void Go(base::Callback<ReturnType(ArgTypes...)> val,
static void Go(base::RepeatingCallback<ReturnType(ArgTypes...)> val,
gin::Arguments* args) {
using Indices = typename IndicesGenerator<sizeof...(ArgTypes)>::type;
Invoker<Indices, ArgTypes...> invoker(args, 0);

View file

@ -12,19 +12,19 @@ namespace gin_helper {
namespace internal {
// This set of templates invokes a base::Callback by converting the Arguments
// into native types. It relies on the function_template.h to provide helper
// templates.
// This set of templates invokes a base::RepeatingCallback by converting the
// Arguments into native types. It relies on the function_template.h to provide
// helper templates.
inline WrappableBase* InvokeFactory(
gin::Arguments* args,
const base::Callback<WrappableBase*()>& callback) {
const base::RepeatingCallback<WrappableBase*()>& callback) {
return callback.Run();
}
template <typename P1>
inline WrappableBase* InvokeFactory(
gin::Arguments* args,
const base::Callback<WrappableBase*(P1)>& callback) {
const base::RepeatingCallback<WrappableBase*(P1)>& callback) {
typename CallbackParamTraits<P1>::LocalType a1;
if (!gin_helper::GetNextArgument(args, 0, true, &a1))
return nullptr;
@ -34,7 +34,7 @@ inline WrappableBase* InvokeFactory(
template <typename P1, typename P2>
inline WrappableBase* InvokeFactory(
gin::Arguments* args,
const base::Callback<WrappableBase*(P1, P2)>& callback) {
const base::RepeatingCallback<WrappableBase*(P1, P2)>& callback) {
typename CallbackParamTraits<P1>::LocalType a1;
typename CallbackParamTraits<P2>::LocalType a2;
if (!gin_helper::GetNextArgument(args, 0, true, &a1) ||
@ -46,7 +46,7 @@ inline WrappableBase* InvokeFactory(
template <typename P1, typename P2, typename P3>
inline WrappableBase* InvokeFactory(
gin::Arguments* args,
const base::Callback<WrappableBase*(P1, P2, P3)>& callback) {
const base::RepeatingCallback<WrappableBase*(P1, P2, P3)>& callback) {
typename CallbackParamTraits<P1>::LocalType a1;
typename CallbackParamTraits<P2>::LocalType a2;
typename CallbackParamTraits<P3>::LocalType a3;
@ -60,7 +60,7 @@ inline WrappableBase* InvokeFactory(
template <typename P1, typename P2, typename P3, typename P4>
inline WrappableBase* InvokeFactory(
gin::Arguments* args,
const base::Callback<WrappableBase*(P1, P2, P3, P4)>& callback) {
const base::RepeatingCallback<WrappableBase*(P1, P2, P3, P4)>& callback) {
typename CallbackParamTraits<P1>::LocalType a1;
typename CallbackParamTraits<P2>::LocalType a2;
typename CallbackParamTraits<P3>::LocalType a3;
@ -76,7 +76,8 @@ inline WrappableBase* InvokeFactory(
template <typename P1, typename P2, typename P3, typename P4, typename P5>
inline WrappableBase* InvokeFactory(
gin::Arguments* args,
const base::Callback<WrappableBase*(P1, P2, P3, P4, P5)>& callback) {
const base::RepeatingCallback<WrappableBase*(P1, P2, P3, P4, P5)>&
callback) {
typename CallbackParamTraits<P1>::LocalType a1;
typename CallbackParamTraits<P2>::LocalType a2;
typename CallbackParamTraits<P3>::LocalType a3;
@ -99,7 +100,8 @@ template <typename P1,
typename P6>
inline WrappableBase* InvokeFactory(
gin::Arguments* args,
const base::Callback<WrappableBase*(P1, P2, P3, P4, P5, P6)>& callback) {
const base::RepeatingCallback<WrappableBase*(P1, P2, P3, P4, P5, P6)>&
callback) {
typename CallbackParamTraits<P1>::LocalType a1;
typename CallbackParamTraits<P2>::LocalType a2;
typename CallbackParamTraits<P3>::LocalType a3;
@ -117,7 +119,7 @@ inline WrappableBase* InvokeFactory(
}
template <typename Sig>
void InvokeNew(const base::Callback<Sig>& factory,
void InvokeNew(const base::RepeatingCallback<Sig>& factory,
v8::Isolate* isolate,
gin_helper::Arguments* args) {
if (!args->IsConstructCall()) {

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) {

View file

@ -32,9 +32,9 @@ class ObjectTemplateBuilder {
}
// In the following methods, T and U can be function pointer, member function
// pointer, base::Callback, or v8::FunctionTemplate. Most clients will want to
// use one of the first two options. Also see gin::CreateFunctionTemplate()
// for creating raw function templates.
// pointer, base::RepeatingCallback, or v8::FunctionTemplate. Most clients
// will want to use one of the first two options. Also see
// gin::CreateFunctionTemplate() for creating raw function templates.
template <typename T>
ObjectTemplateBuilder& SetMethod(const base::StringPiece& name,
const T& callback) {

View file

@ -24,7 +24,7 @@ class Wrappable : public WrappableBase {
template <typename Sig>
static void SetConstructor(v8::Isolate* isolate,
const base::Callback<Sig>& constructor) {
const base::RepeatingCallback<Sig>& constructor) {
v8::Local<v8::FunctionTemplate> templ = gin_helper::CreateFunctionTemplate(
isolate, base::BindRepeating(&internal::InvokeNew<Sig>, constructor));
templ->InstanceTemplate()->SetInternalFieldCount(1);

View file

@ -16,7 +16,7 @@ namespace electron {
class GuestViewContainer {
public:
typedef base::Callback<void(const gfx::Size&)> ResizeCallback;
typedef base::RepeatingCallback<void(const gfx::Size&)> ResizeCallback;
explicit GuestViewContainer(content::RenderFrame* render_frame);
virtual ~GuestViewContainer();