chore: Bind=>BindRepeating for constructors (#17924)

This commit is contained in:
Shelley Vohr 2019-04-24 11:29:59 -07:00 committed by GitHub
parent aed0b1ee54
commit 02c7b92095
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 15 additions and 11 deletions

View file

@ -219,7 +219,7 @@ class App : public AtomBrowserClient::Delegate,
#endif
#if defined(MAS_BUILD)
base::Callback<void()> StartAccessingSecurityScopedResource(
base::RepeatingCallback<void()> StartAccessingSecurityScopedResource(
mate::Arguments* args);
#endif

View file

@ -19,7 +19,7 @@ void OnStopAccessingSecurityScopedResource(NSURL* bookmarkUrl) {
}
// Get base64 encoded NSData, create a bookmark for it and start accessing it.
base::Callback<void()> App::StartAccessingSecurityScopedResource(
base::RepeatingCallback<void()> App::StartAccessingSecurityScopedResource(
mate::Arguments* args) {
std::string data;
args->GetNext(&data);
@ -55,7 +55,8 @@ base::Callback<void()> 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

View file

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

View file

@ -165,7 +165,7 @@ void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Context> 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)

View file

@ -241,7 +241,7 @@ void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Context> 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(

View file

@ -51,7 +51,7 @@ void Initialize(v8::Local<v8::Object> 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));

View file

@ -258,7 +258,8 @@ void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Context> 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)

View file

@ -1190,7 +1190,8 @@ void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Context> 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)

View file

@ -262,7 +262,7 @@ void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Context> 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(

View file

@ -73,7 +73,7 @@ void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Context> 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,