From 02c7b9209559aea8d4d7ed0c99f941e042f110e7 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Wed, 24 Apr 2019 11:29:59 -0700 Subject: [PATCH] chore: Bind=>BindRepeating for constructors (#17924) --- atom/browser/api/atom_api_app.h | 2 +- atom/browser/api/atom_api_app_mas.mm | 5 +++-- atom/browser/api/atom_api_auto_updater.cc | 3 ++- atom/browser/api/atom_api_browser_view.cc | 2 +- atom/browser/api/atom_api_menu.cc | 2 +- atom/browser/api/atom_api_net.cc | 2 +- atom/browser/api/atom_api_notification.cc | 3 ++- atom/browser/api/atom_api_top_level_window.cc | 3 ++- atom/browser/api/atom_api_tray.cc | 2 +- atom/browser/api/atom_api_view.cc | 2 +- 10 files changed, 15 insertions(+), 11 deletions(-) diff --git a/atom/browser/api/atom_api_app.h b/atom/browser/api/atom_api_app.h index 0af4b42dfb78..a56630a54405 100644 --- a/atom/browser/api/atom_api_app.h +++ b/atom/browser/api/atom_api_app.h @@ -219,7 +219,7 @@ class App : public AtomBrowserClient::Delegate, #endif #if defined(MAS_BUILD) - base::Callback StartAccessingSecurityScopedResource( + base::RepeatingCallback StartAccessingSecurityScopedResource( mate::Arguments* args); #endif diff --git a/atom/browser/api/atom_api_app_mas.mm b/atom/browser/api/atom_api_app_mas.mm index 7fc946eadda1..6cec5a1512a4 100644 --- a/atom/browser/api/atom_api_app_mas.mm +++ b/atom/browser/api/atom_api_app_mas.mm @@ -19,7 +19,7 @@ void OnStopAccessingSecurityScopedResource(NSURL* bookmarkUrl) { } // Get base64 encoded NSData, create a bookmark for it and start accessing it. -base::Callback App::StartAccessingSecurityScopedResource( +base::RepeatingCallback App::StartAccessingSecurityScopedResource( mate::Arguments* args) { std::string data; args->GetNext(&data); @@ -55,7 +55,8 @@ base::Callback App::StartAccessingSecurityScopedResource( [bookmarkUrl retain]; // Return a js callback which will close the bookmark. - return base::Bind(&OnStopAccessingSecurityScopedResource, bookmarkUrl); + return base::BindRepeating(&OnStopAccessingSecurityScopedResource, + bookmarkUrl); } } // namespace atom diff --git a/atom/browser/api/atom_api_auto_updater.cc b/atom/browser/api/atom_api_auto_updater.cc index e61e454805c8..c3a9c95503f7 100644 --- a/atom/browser/api/atom_api_auto_updater.cc +++ b/atom/browser/api/atom_api_auto_updater.cc @@ -91,7 +91,8 @@ void AutoUpdater::OnUpdateDownloaded(const std::string& release_notes, const std::string& url) { Emit("update-downloaded", release_notes, release_name, release_date, url, // Keep compatibility with old APIs. - base::Bind(&AutoUpdater::QuitAndInstall, base::Unretained(this))); + base::BindRepeating(&AutoUpdater::QuitAndInstall, + base::Unretained(this))); } void AutoUpdater::OnWindowAllClosed() { diff --git a/atom/browser/api/atom_api_browser_view.cc b/atom/browser/api/atom_api_browser_view.cc index be5c31ca0126..4dfdb15da7ba 100644 --- a/atom/browser/api/atom_api_browser_view.cc +++ b/atom/browser/api/atom_api_browser_view.cc @@ -165,7 +165,7 @@ void Initialize(v8::Local exports, v8::Local context, void* priv) { v8::Isolate* isolate = context->GetIsolate(); - BrowserView::SetConstructor(isolate, base::Bind(&BrowserView::New)); + BrowserView::SetConstructor(isolate, base::BindRepeating(&BrowserView::New)); mate::Dictionary browser_view(isolate, BrowserView::GetConstructor(isolate) ->GetFunction(context) diff --git a/atom/browser/api/atom_api_menu.cc b/atom/browser/api/atom_api_menu.cc index 296de0195874..0e22755c4ac1 100644 --- a/atom/browser/api/atom_api_menu.cc +++ b/atom/browser/api/atom_api_menu.cc @@ -241,7 +241,7 @@ void Initialize(v8::Local exports, v8::Local context, void* priv) { v8::Isolate* isolate = context->GetIsolate(); - Menu::SetConstructor(isolate, base::Bind(&Menu::New)); + Menu::SetConstructor(isolate, base::BindRepeating(&Menu::New)); mate::Dictionary dict(isolate, exports); dict.Set( diff --git a/atom/browser/api/atom_api_net.cc b/atom/browser/api/atom_api_net.cc index c46f3a8ce6df..890fa028b672 100644 --- a/atom/browser/api/atom_api_net.cc +++ b/atom/browser/api/atom_api_net.cc @@ -51,7 +51,7 @@ void Initialize(v8::Local exports, void* priv) { v8::Isolate* isolate = context->GetIsolate(); - URLRequest::SetConstructor(isolate, base::Bind(URLRequest::New)); + URLRequest::SetConstructor(isolate, base::BindRepeating(URLRequest::New)); mate::Dictionary dict(isolate, exports); dict.Set("net", Net::Create(isolate)); diff --git a/atom/browser/api/atom_api_notification.cc b/atom/browser/api/atom_api_notification.cc index 0d0a735d8a46..023e6d06d8e2 100644 --- a/atom/browser/api/atom_api_notification.cc +++ b/atom/browser/api/atom_api_notification.cc @@ -258,7 +258,8 @@ void Initialize(v8::Local exports, v8::Local context, void* priv) { v8::Isolate* isolate = context->GetIsolate(); - Notification::SetConstructor(isolate, base::Bind(&Notification::New)); + Notification::SetConstructor(isolate, + base::BindRepeating(&Notification::New)); mate::Dictionary dict(isolate, exports); dict.Set("Notification", Notification::GetConstructor(isolate) diff --git a/atom/browser/api/atom_api_top_level_window.cc b/atom/browser/api/atom_api_top_level_window.cc index 17f38da7108f..3cf8ed7382ec 100644 --- a/atom/browser/api/atom_api_top_level_window.cc +++ b/atom/browser/api/atom_api_top_level_window.cc @@ -1190,7 +1190,8 @@ void Initialize(v8::Local exports, v8::Local context, void* priv) { v8::Isolate* isolate = context->GetIsolate(); - TopLevelWindow::SetConstructor(isolate, base::Bind(&TopLevelWindow::New)); + TopLevelWindow::SetConstructor(isolate, + base::BindRepeating(&TopLevelWindow::New)); mate::Dictionary constructor(isolate, TopLevelWindow::GetConstructor(isolate) ->GetFunction(context) diff --git a/atom/browser/api/atom_api_tray.cc b/atom/browser/api/atom_api_tray.cc index 881bd5d84e43..19d32a4dd75b 100644 --- a/atom/browser/api/atom_api_tray.cc +++ b/atom/browser/api/atom_api_tray.cc @@ -262,7 +262,7 @@ void Initialize(v8::Local exports, v8::Local context, void* priv) { v8::Isolate* isolate = context->GetIsolate(); - Tray::SetConstructor(isolate, base::Bind(&Tray::New)); + Tray::SetConstructor(isolate, base::BindRepeating(&Tray::New)); mate::Dictionary dict(isolate, exports); dict.Set( diff --git a/atom/browser/api/atom_api_view.cc b/atom/browser/api/atom_api_view.cc index 64de07ef8650..44041c1e169b 100644 --- a/atom/browser/api/atom_api_view.cc +++ b/atom/browser/api/atom_api_view.cc @@ -73,7 +73,7 @@ void Initialize(v8::Local exports, v8::Local context, void* priv) { v8::Isolate* isolate = context->GetIsolate(); - View::SetConstructor(isolate, base::Bind(&View::New)); + View::SetConstructor(isolate, base::BindRepeating(&View::New)); mate::Dictionary constructor( isolate,