chore: convert View APIs away from base::Bind (#18035)

This commit is contained in:
Shelley Vohr 2019-04-29 17:40:39 -07:00 committed by Cheng Zhao
parent 4a3771ff7f
commit 4ee201c56e
14 changed files with 40 additions and 32 deletions

View file

@ -1353,7 +1353,7 @@ void App::BuildPrototype(v8::Isolate* isolate,
.SetMethod("clearRecentDocuments",
base::BindRepeating(&Browser::ClearRecentDocuments, browser))
.SetMethod("setAppUserModelId",
base::Bind(&Browser::SetAppUserModelID, browser))
base::BindRepeating(&Browser::SetAppUserModelID, browser))
.SetMethod(
"isDefaultProtocolClient",
base::BindRepeating(&Browser::IsDefaultProtocolClient, browser))

View file

@ -110,7 +110,7 @@ void NetLog::OnNewState(const base::DictionaryValue& state) {
for (auto& promise : stop_callback_queue_) {
// TODO(zcbenz): Remove the use of CopyablePromise when the
// GetFilePathToCompletedLog API accepts OnceCallback.
net_log_writer_->GetFilePathToCompletedLog(base::Bind(
net_log_writer_->GetFilePathToCompletedLog(base::BindRepeating(
util::CopyablePromise::ResolveCopyablePromise<const base::FilePath&>,
util::CopyablePromise(promise)));
}

View file

@ -37,11 +37,11 @@ namespace api {
PowerMonitor::PowerMonitor(v8::Isolate* isolate) {
#if defined(OS_LINUX)
SetShutdownHandler(
base::Bind(&PowerMonitor::ShouldShutdown, base::Unretained(this)));
SetShutdownHandler(base::BindRepeating(&PowerMonitor::ShouldShutdown,
base::Unretained(this)));
#elif defined(OS_MACOSX)
Browser::Get()->SetShutdownHandler(
base::Bind(&PowerMonitor::ShouldShutdown, base::Unretained(this)));
Browser::Get()->SetShutdownHandler(base::BindRepeating(
&PowerMonitor::ShouldShutdown, base::Unretained(this)));
#endif
base::PowerMonitor::Get()->AddObserver(this);
Init(isolate);

View file

@ -124,8 +124,9 @@ void Initialize(v8::Local<v8::Object> exports,
void* priv) {
v8::Isolate* isolate = context->GetIsolate();
mate::Dictionary dict(isolate, exports);
dict.Set("WebContentsView", mate::CreateConstructor<WebContentsView>(
isolate, base::Bind(&WebContentsView::New)));
dict.Set("WebContentsView",
mate::CreateConstructor<WebContentsView>(
isolate, base::BindRepeating(&WebContentsView::New)));
}
} // namespace

View file

@ -78,7 +78,7 @@ void Initialize(v8::Local<v8::Object> exports,
v8::Isolate* isolate = context->GetIsolate();
mate::Dictionary dict(isolate, exports);
dict.Set("BoxLayout", mate::CreateConstructor<BoxLayout>(
isolate, base::Bind(&BoxLayout::New)));
isolate, base::BindRepeating(&BoxLayout::New)));
}
} // namespace

View file

@ -50,8 +50,8 @@ void Initialize(v8::Local<v8::Object> exports,
void* priv) {
v8::Isolate* isolate = context->GetIsolate();
mate::Dictionary dict(isolate, exports);
dict.Set("Button",
mate::CreateConstructor<Button>(isolate, base::Bind(&Button::New)));
dict.Set("Button", mate::CreateConstructor<Button>(
isolate, base::BindRepeating(&Button::New)));
}
} // namespace

View file

@ -71,7 +71,7 @@ void Initialize(v8::Local<v8::Object> exports,
v8::Isolate* isolate = context->GetIsolate();
mate::Dictionary dict(isolate, exports);
dict.Set("LabelButton", mate::CreateConstructor<LabelButton>(
isolate, base::Bind(&LabelButton::New)));
isolate, base::BindRepeating(&LabelButton::New)));
}
} // namespace

View file

@ -53,8 +53,9 @@ void Initialize(v8::Local<v8::Object> exports,
void* priv) {
v8::Isolate* isolate = context->GetIsolate();
mate::Dictionary dict(isolate, exports);
dict.Set("LayoutManager", mate::CreateConstructor<LayoutManager>(
isolate, base::Bind(&LayoutManager::New)));
dict.Set("LayoutManager",
mate::CreateConstructor<LayoutManager>(
isolate, base::BindRepeating(&LayoutManager::New)));
}
} // namespace

View file

@ -47,8 +47,9 @@ void Initialize(v8::Local<v8::Object> exports,
void* priv) {
v8::Isolate* isolate = context->GetIsolate();
mate::Dictionary dict(isolate, exports);
dict.Set("MdTextButton", mate::CreateConstructor<MdTextButton>(
isolate, base::Bind(&MdTextButton::New)));
dict.Set("MdTextButton",
mate::CreateConstructor<MdTextButton>(
isolate, base::BindRepeating(&MdTextButton::New)));
}
} // namespace

View file

@ -51,7 +51,7 @@ void Initialize(v8::Local<v8::Object> exports,
v8::Isolate* isolate = context->GetIsolate();
mate::Dictionary dict(isolate, exports);
dict.Set("ResizeArea", mate::CreateConstructor<ResizeArea>(
isolate, base::Bind(&ResizeArea::New)));
isolate, base::BindRepeating(&ResizeArea::New)));
}
} // namespace

View file

@ -58,7 +58,7 @@ void Initialize(v8::Local<v8::Object> exports,
v8::Isolate* isolate = context->GetIsolate();
mate::Dictionary dict(isolate, exports);
dict.Set("TextField", mate::CreateConstructor<TextField>(
isolate, base::Bind(&TextField::New)));
isolate, base::BindRepeating(&TextField::New)));
}
} // namespace