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

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

Issue 1921923002: Convert //components/[o-t]* from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 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
« no previous file with comments | « components/precache/core/precache_fetcher.h ('k') | components/precache/core/precache_fetcher_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/precache/core/precache_fetcher.cc
diff --git a/components/precache/core/precache_fetcher.cc b/components/precache/core/precache_fetcher.cc
index bb5f67f28dd24e5986f593809dca23b029e0e7fe..e7a5a0bce807a63ca3c8913f66924d154b331601 100644
--- a/components/precache/core/precache_fetcher.cc
+++ b/components/precache/core/precache_fetcher.cc
@@ -16,6 +16,7 @@
#include "base/compiler_specific.h"
#include "base/containers/hash_tables.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "components/precache/core/precache_switches.h"
#include "components/precache/core/proto/precache.pb.h"
@@ -178,7 +179,7 @@ void PrecacheFetcher::Fetcher::LoadFromCache() {
net::URLFetcher::Create(url_, net::URLFetcher::GET, this);
cache_url_fetcher_->SetRequestContext(request_context_);
cache_url_fetcher_->SetLoadFlags(net::LOAD_ONLY_FROM_CACHE | kNoTracking);
- scoped_ptr<URLFetcherNullWriter> null_writer(new URLFetcherNullWriter);
+ std::unique_ptr<URLFetcherNullWriter> null_writer(new URLFetcherNullWriter);
cache_url_fetcher_->SaveResponseWithWriter(std::move(null_writer));
cache_url_fetcher_->Start();
}
@@ -195,7 +196,7 @@ void PrecacheFetcher::Fetcher::LoadFromNetwork() {
network_url_fetcher_->SetLoadFlags(net::LOAD_VALIDATE_CACHE | kNoTracking);
// We don't need a copy of the response body for resource requests. The
// request is issued only to populate the browser cache.
- scoped_ptr<URLFetcherNullWriter> null_writer(new URLFetcherNullWriter);
+ std::unique_ptr<URLFetcherNullWriter> null_writer(new URLFetcherNullWriter);
network_url_fetcher_->SaveResponseWithWriter(std::move(null_writer));
} else {
// Config and manifest requests do not need to be revalidated. It's okay if
@@ -321,7 +322,7 @@ 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(scoped_ptr<Fetcher>(new Fetcher(
+ pool_.Add(base::WrapUnique(new Fetcher(
request_context_.get(), config_url,
base::Bind(&PrecacheFetcher::OnConfigFetchComplete,
base::Unretained(this)),
@@ -334,7 +335,7 @@ void PrecacheFetcher::StartNextResourceFetch() {
std::min(config_->max_bytes_per_resource(),
config_->max_bytes_total() - total_response_bytes_);
VLOG(3) << "Fetching " << resource_urls_to_fetch_.front();
- pool_.Add(scoped_ptr<Fetcher>(
+ pool_.Add(base::WrapUnique(
new Fetcher(request_context_.get(), resource_urls_to_fetch_.front(),
base::Bind(&PrecacheFetcher::OnResourceFetchComplete,
base::Unretained(this)),
@@ -354,7 +355,7 @@ void PrecacheFetcher::StartNextManifestFetch() {
<< "There are no available parallel requests to fetch the next manifest. "
"Did you forget to call Delete?";
VLOG(3) << "Fetching " << manifest_urls_to_fetch_.front();
- pool_.Add(scoped_ptr<Fetcher>(new Fetcher(
+ pool_.Add(base::WrapUnique(new Fetcher(
request_context_.get(), manifest_urls_to_fetch_.front(),
base::Bind(&PrecacheFetcher::OnManifestFetchComplete,
base::Unretained(this)),
« no previous file with comments | « components/precache/core/precache_fetcher.h ('k') | components/precache/core/precache_fetcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698