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

Side by Side Diff: components/precache/core/precache_fetcher.cc

Issue 1117703002: Adjust URLFetcher::Create API so that object is returned as scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unneeded Pass() calls Created 5 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/precache/core/precache_fetcher.h" 5 #include "components/precache/core/precache_fetcher.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 const base::Callback<void(const URLFetcher&)> callback_; 114 const base::Callback<void(const URLFetcher&)> callback_;
115 scoped_ptr<URLFetcher> url_fetcher_; 115 scoped_ptr<URLFetcher> url_fetcher_;
116 116
117 DISALLOW_COPY_AND_ASSIGN(Fetcher); 117 DISALLOW_COPY_AND_ASSIGN(Fetcher);
118 }; 118 };
119 119
120 PrecacheFetcher::Fetcher::Fetcher( 120 PrecacheFetcher::Fetcher::Fetcher(
121 net::URLRequestContextGetter* request_context, const GURL& url, 121 net::URLRequestContextGetter* request_context, const GURL& url,
122 const base::Callback<void(const URLFetcher&)>& callback) 122 const base::Callback<void(const URLFetcher&)>& callback)
123 : callback_(callback) { 123 : callback_(callback) {
124 url_fetcher_.reset(URLFetcher::Create(url, URLFetcher::GET, this)); 124 url_fetcher_ = URLFetcher::Create(url, URLFetcher::GET, this);
125 url_fetcher_->SetRequestContext(request_context); 125 url_fetcher_->SetRequestContext(request_context);
126 url_fetcher_->Start(); 126 url_fetcher_->Start();
127 } 127 }
128 128
129 void PrecacheFetcher::Fetcher::OnURLFetchComplete(const URLFetcher* source) { 129 void PrecacheFetcher::Fetcher::OnURLFetchComplete(const URLFetcher* source) {
130 callback_.Run(*source); 130 callback_.Run(*source);
131 } 131 }
132 132
133 PrecacheFetcher::PrecacheFetcher( 133 PrecacheFetcher::PrecacheFetcher(
134 const std::list<GURL>& starting_urls, 134 const std::list<GURL>& starting_urls,
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 StartNextFetch(); 247 StartNextFetch();
248 } 248 }
249 249
250 void PrecacheFetcher::OnResourceFetchComplete(const URLFetcher& source) { 250 void PrecacheFetcher::OnResourceFetchComplete(const URLFetcher& source) {
251 // The resource has already been put in the cache during the fetch process, so 251 // The resource has already been put in the cache during the fetch process, so
252 // nothing more needs to be done for the resource. 252 // nothing more needs to be done for the resource.
253 StartNextFetch(); 253 StartNextFetch();
254 } 254 }
255 255
256 } // namespace precache 256 } // namespace precache
OLDNEW
« no previous file with comments | « components/policy/core/common/cloud/user_info_fetcher.cc ('k') | components/rappor/log_uploader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698