Commit 3b56e0f3 authored by danakj's avatar danakj Committed by Commit Bot

Convert Callbacks to OnceCallbacks for //content/app/

Use OnceCallback where possible, and BindRepeating where it is
meant to be called more than once.

The Closure here was explicitly a RepeatingClosure in one place,
but it really should be a OnceClosure. The closure is used to
exit the RunLoop, which can't occur more than once. It is
currently not used at all.

R=jam@chromium.org

Bug: 953861
Change-Id: I8a6b2a36b10c8fe523d163cf26fccaa8b155a319
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1934785Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#719186}
parent 27482c2b
...@@ -389,7 +389,6 @@ _NOT_CONVERTED_TO_MODERN_BIND_AND_CALLBACK = '|'.join(( ...@@ -389,7 +389,6 @@ _NOT_CONVERTED_TO_MODERN_BIND_AND_CALLBACK = '|'.join((
'^components/webdata_services/', '^components/webdata_services/',
'^components/wifi/', '^components/wifi/',
'^components/zoom/', '^components/zoom/',
'^content/app/',
'^content/browser/', '^content/browser/',
'^content/child/', '^content/child/',
'^content/public/', '^content/public/',
......
...@@ -111,10 +111,10 @@ void ContentServiceManagerMainDelegate::AdjustServiceProcessCommandLine( ...@@ -111,10 +111,10 @@ void ContentServiceManagerMainDelegate::AdjustServiceProcessCommandLine(
} }
void ContentServiceManagerMainDelegate::OnServiceManagerInitialized( void ContentServiceManagerMainDelegate::OnServiceManagerInitialized(
const base::Closure& quit_closure, base::OnceClosure quit_closure,
service_manager::BackgroundServiceManager* service_manager) { service_manager::BackgroundServiceManager* service_manager) {
return content_main_params_.delegate->OnServiceManagerInitialized( return content_main_params_.delegate->OnServiceManagerInitialized(
quit_closure, service_manager); std::move(quit_closure), service_manager);
} }
std::unique_ptr<service_manager::Service> std::unique_ptr<service_manager::Service>
......
...@@ -37,7 +37,7 @@ class ContentServiceManagerMainDelegate : public service_manager::MainDelegate { ...@@ -37,7 +37,7 @@ class ContentServiceManagerMainDelegate : public service_manager::MainDelegate {
const service_manager::Identity& identity, const service_manager::Identity& identity,
base::CommandLine* command_line) override; base::CommandLine* command_line) override;
void OnServiceManagerInitialized( void OnServiceManagerInitialized(
const base::Closure& quit_closure, base::OnceClosure quit_closure,
service_manager::BackgroundServiceManager* service_manager) override; service_manager::BackgroundServiceManager* service_manager) override;
std::unique_ptr<service_manager::Service> CreateEmbeddedService( std::unique_ptr<service_manager::Service> CreateEmbeddedService(
const std::string& service_name) override; const std::string& service_name) override;
......
...@@ -64,7 +64,7 @@ void ContentMainDelegate::AdjustServiceProcessCommandLine( ...@@ -64,7 +64,7 @@ void ContentMainDelegate::AdjustServiceProcessCommandLine(
base::CommandLine* command_line) {} base::CommandLine* command_line) {}
void ContentMainDelegate::OnServiceManagerInitialized( void ContentMainDelegate::OnServiceManagerInitialized(
const base::Closure& quit_closure, base::OnceClosure quit_closure,
service_manager::BackgroundServiceManager* service_manager) {} service_manager::BackgroundServiceManager* service_manager) {}
bool ContentMainDelegate::ShouldCreateFeatureList() { bool ContentMainDelegate::ShouldCreateFeatureList() {
......
...@@ -118,7 +118,7 @@ class CONTENT_EXPORT ContentMainDelegate { ...@@ -118,7 +118,7 @@ class CONTENT_EXPORT ContentMainDelegate {
// |quit_closure| is a callback the embedder may retain and invoke at any time // |quit_closure| is a callback the embedder may retain and invoke at any time
// to cleanly terminate Service Manager execution. // to cleanly terminate Service Manager execution.
virtual void OnServiceManagerInitialized( virtual void OnServiceManagerInitialized(
const base::Closure& quit_closure, base::OnceClosure quit_closure,
service_manager::BackgroundServiceManager* service_manager); service_manager::BackgroundServiceManager* service_manager);
// Allows the embedder to perform platform-specific initialization before // Allows the embedder to perform platform-specific initialization before
......
...@@ -40,7 +40,7 @@ void MainDelegate::AdjustServiceProcessCommandLine( ...@@ -40,7 +40,7 @@ void MainDelegate::AdjustServiceProcessCommandLine(
base::CommandLine* command_line) {} base::CommandLine* command_line) {}
void MainDelegate::OnServiceManagerInitialized( void MainDelegate::OnServiceManagerInitialized(
const base::RepeatingClosure& quit_closure, base::OnceClosure quit_closure,
BackgroundServiceManager* service_manager) {} BackgroundServiceManager* service_manager) {}
std::unique_ptr<Service> MainDelegate::CreateEmbeddedService( std::unique_ptr<Service> MainDelegate::CreateEmbeddedService(
......
...@@ -96,7 +96,7 @@ class COMPONENT_EXPORT(SERVICE_MANAGER_EMBEDDER) MainDelegate { ...@@ -96,7 +96,7 @@ class COMPONENT_EXPORT(SERVICE_MANAGER_EMBEDDER) MainDelegate {
// |quit_closure| is a callback the embedder may retain and invoke at any time // |quit_closure| is a callback the embedder may retain and invoke at any time
// to cleanly terminate Service Manager execution. // to cleanly terminate Service Manager execution.
virtual void OnServiceManagerInitialized( virtual void OnServiceManagerInitialized(
const base::RepeatingClosure& quit_closure, base::OnceClosure quit_closure,
BackgroundServiceManager* service_manager); BackgroundServiceManager* service_manager);
// Runs an embedded service by name. If the embedder does not know how to // Runs an embedded service by name. If the embedder does not know how to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment