Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Unified Diff: components/precache/core/precache_fetcher.cc

Issue 2257793002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/precache/core/precache_fetcher.cc
diff --git a/components/precache/core/precache_fetcher.cc b/components/precache/core/precache_fetcher.cc
index 8b7589ba8696053987166343f2a461f8a80ffaea..90d05bb776b6eb6b841c69369f29a3acc5846c87 100644
--- a/components/precache/core/precache_fetcher.cc
+++ b/components/precache/core/precache_fetcher.cc
@@ -456,10 +456,10 @@ void PrecacheFetcher::Start() {
// Fetch the precache configuration settings from the server.
DCHECK(pool_.IsEmpty()) << "All parallel requests should be available";
VLOG(3) << "Fetching " << config_url;
- pool_.Add(base::WrapUnique(new Fetcher(
+ pool_.Add(base::MakeUnique<Fetcher>(
request_context_.get(), config_url, std::string(),
base::Bind(&PrecacheFetcher::OnConfigFetchComplete, AsWeakPtr()),
- false /* is_resource_request */, std::numeric_limits<int32_t>::max())));
+ false /* is_resource_request */, std::numeric_limits<int32_t>::max()));
}
void PrecacheFetcher::StartNextResourceFetch() {
@@ -471,10 +471,10 @@ void PrecacheFetcher::StartNextResourceFetch() {
unfinished_work_->config_settings().max_bytes_total() -
unfinished_work_->total_bytes());
VLOG(3) << "Fetching " << resource.first << " " << resource.second;
- pool_.Add(base::WrapUnique(new Fetcher(
+ pool_.Add(base::MakeUnique<Fetcher>(
request_context_.get(), resource.first, resource.second,
base::Bind(&PrecacheFetcher::OnResourceFetchComplete, AsWeakPtr()),
- true /* is_resource_request */, max_bytes)));
+ true /* is_resource_request */, max_bytes));
resources_to_fetch_.pop_front();
}
@@ -487,11 +487,11 @@ void PrecacheFetcher::StartNextManifestFetch() {
// We only fetch one manifest at a time to keep the size of
// resources_to_fetch_ as small as possible.
VLOG(3) << "Fetching " << top_hosts_to_fetch_.front().manifest_url;
- pool_.Add(base::WrapUnique(new Fetcher(
+ pool_.Add(base::MakeUnique<Fetcher>(
request_context_.get(), top_hosts_to_fetch_.front().manifest_url,
top_hosts_to_fetch_.front().hostname,
base::Bind(&PrecacheFetcher::OnManifestFetchComplete, AsWeakPtr()),
- false /* is_resource_request */, std::numeric_limits<int32_t>::max())));
+ false /* is_resource_request */, std::numeric_limits<int32_t>::max()));
top_hosts_to_fetch_.pop_front();
}
« no previous file with comments | « components/ntp_snippets/ntp_snippets_fetcher_unittest.cc ('k') | components/prefs/in_memory_pref_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698