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

Side by Side Diff: components/update_client/url_fetcher_downloader.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
« no previous file with comments | « components/update_client/request_sender.cc ('k') | components/update_client/utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/update_client/url_fetcher_downloader.h" 5 #include "components/update_client/url_fetcher_downloader.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/sequenced_task_runner.h" 10 #include "base/sequenced_task_runner.h"
(...skipping 15 matching lines...) Expand all
26 total_bytes_(-1) { 26 total_bytes_(-1) {
27 } 27 }
28 28
29 UrlFetcherDownloader::~UrlFetcherDownloader() { 29 UrlFetcherDownloader::~UrlFetcherDownloader() {
30 DCHECK(thread_checker_.CalledOnValidThread()); 30 DCHECK(thread_checker_.CalledOnValidThread());
31 } 31 }
32 32
33 void UrlFetcherDownloader::DoStartDownload(const GURL& url) { 33 void UrlFetcherDownloader::DoStartDownload(const GURL& url) {
34 DCHECK(thread_checker_.CalledOnValidThread()); 34 DCHECK(thread_checker_.CalledOnValidThread());
35 35
36 url_fetcher_.reset( 36 url_fetcher_ = net::URLFetcher::Create(0, url, net::URLFetcher::GET, this);
37 net::URLFetcher::Create(0, url, net::URLFetcher::GET, this));
38 url_fetcher_->SetRequestContext(context_getter_); 37 url_fetcher_->SetRequestContext(context_getter_);
39 url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | 38 url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
40 net::LOAD_DO_NOT_SAVE_COOKIES | 39 net::LOAD_DO_NOT_SAVE_COOKIES |
41 net::LOAD_DISABLE_CACHE); 40 net::LOAD_DISABLE_CACHE);
42 url_fetcher_->SetAutomaticallyRetryOn5xx(false); 41 url_fetcher_->SetAutomaticallyRetryOn5xx(false);
43 url_fetcher_->SaveResponseToTemporaryFile(task_runner_); 42 url_fetcher_->SaveResponseToTemporaryFile(task_runner_);
44 43
45 VLOG(1) << "Starting background download: " << url.spec(); 44 VLOG(1) << "Starting background download: " << url.spec();
46 url_fetcher_->Start(); 45 url_fetcher_->Start();
47 46
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 total_bytes_ = total; 99 total_bytes_ = total;
101 100
102 Result result; 101 Result result;
103 result.downloaded_bytes = downloaded_bytes_; 102 result.downloaded_bytes = downloaded_bytes_;
104 result.total_bytes = total_bytes_; 103 result.total_bytes = total_bytes_;
105 104
106 OnDownloadProgress(result); 105 OnDownloadProgress(result);
107 } 106 }
108 107
109 } // namespace update_client 108 } // namespace update_client
OLDNEW
« no previous file with comments | « components/update_client/request_sender.cc ('k') | components/update_client/utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698