Commit ab602593 authored by Xida Chen's avatar Xida Chen Committed by Commit Bot

Convert base::Closure in chrome/browser/importer

This is a code health CL, no behavior change is expected.

Bug: 1007635
Change-Id: I416970f3ccd80e32c62fc7c5f7f246337d4b7fac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2280142Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Commit-Queue: Xida Chen <xidachen@chromium.org>
Auto-Submit: Xida Chen <xidachen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#785708}
parent fa6a9612
...@@ -194,7 +194,7 @@ ImporterList::~ImporterList() { ...@@ -194,7 +194,7 @@ ImporterList::~ImporterList() {
void ImporterList::DetectSourceProfiles( void ImporterList::DetectSourceProfiles(
const std::string& locale, const std::string& locale,
bool include_interactive_profiles, bool include_interactive_profiles,
const base::Closure& profiles_loaded_callback) { base::OnceClosure profiles_loaded_callback) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
base::ThreadPool::PostTaskAndReplyWithResult( base::ThreadPool::PostTaskAndReplyWithResult(
FROM_HERE, FROM_HERE,
...@@ -203,7 +203,8 @@ void ImporterList::DetectSourceProfiles( ...@@ -203,7 +203,8 @@ void ImporterList::DetectSourceProfiles(
base::BindOnce(&DetectSourceProfilesWorker, locale, base::BindOnce(&DetectSourceProfilesWorker, locale,
include_interactive_profiles), include_interactive_profiles),
base::BindOnce(&ImporterList::SourceProfilesLoaded, base::BindOnce(&ImporterList::SourceProfilesLoaded,
weak_ptr_factory_.GetWeakPtr(), profiles_loaded_callback)); weak_ptr_factory_.GetWeakPtr(),
std::move(profiles_loaded_callback)));
} }
const importer::SourceProfile& ImporterList::GetSourceProfileAt( const importer::SourceProfile& ImporterList::GetSourceProfileAt(
...@@ -213,10 +214,10 @@ const importer::SourceProfile& ImporterList::GetSourceProfileAt( ...@@ -213,10 +214,10 @@ const importer::SourceProfile& ImporterList::GetSourceProfileAt(
} }
void ImporterList::SourceProfilesLoaded( void ImporterList::SourceProfilesLoaded(
const base::Closure& profiles_loaded_callback, base::OnceClosure profiles_loaded_callback,
const std::vector<importer::SourceProfile>& profiles) { const std::vector<importer::SourceProfile>& profiles) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
source_profiles_.assign(profiles.begin(), profiles.end()); source_profiles_.assign(profiles.begin(), profiles.end());
profiles_loaded_callback.Run(); std::move(profiles_loaded_callback).Run();
} }
...@@ -35,7 +35,7 @@ class ImporterList { ...@@ -35,7 +35,7 @@ class ImporterList {
// alive, run the callback when the source profile detection finishes. // alive, run the callback when the source profile detection finishes.
void DetectSourceProfiles(const std::string& locale, void DetectSourceProfiles(const std::string& locale,
bool include_interactive_profiles, bool include_interactive_profiles,
const base::Closure& profiles_loaded_callback); base::OnceClosure profiles_loaded_callback);
// Returns the number of different source profiles you can import from. // Returns the number of different source profiles you can import from.
size_t count() const { return source_profiles_.size(); } size_t count() const { return source_profiles_.size(); }
...@@ -49,7 +49,7 @@ class ImporterList { ...@@ -49,7 +49,7 @@ class ImporterList {
// Called when the source profiles are loaded. Copies the loaded profiles // Called when the source profiles are loaded. Copies the loaded profiles
// in |profiles| and calls |profiles_loaded_callback|. // in |profiles| and calls |profiles_loaded_callback|.
void SourceProfilesLoaded( void SourceProfilesLoaded(
const base::Closure& profiles_loaded_callback, base::OnceClosure profiles_loaded_callback,
const std::vector<importer::SourceProfile>& profiles); const std::vector<importer::SourceProfile>& profiles);
// The list of profiles with the default one first. // The list of profiles with the default one first.
......
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