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

Side by Side Diff: chrome/browser/net/file_downloader.cc

Issue 2133083002: Remove all remaining traces of MessageLoopProxy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/net/file_downloader.h" 5 #include "chrome/browser/net/file_downloader.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 15 matching lines...) Expand all
26 const DownloadFinishedCallback& callback) 26 const DownloadFinishedCallback& callback)
27 : callback_(callback), 27 : callback_(callback),
28 fetcher_(URLFetcher::Create(url, URLFetcher::GET, this)), 28 fetcher_(URLFetcher::Create(url, URLFetcher::GET, this)),
29 local_path_(path), 29 local_path_(path),
30 weak_ptr_factory_(this) { 30 weak_ptr_factory_(this) {
31 fetcher_->SetRequestContext(request_context); 31 fetcher_->SetRequestContext(request_context);
32 fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | 32 fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
33 net::LOAD_DO_NOT_SAVE_COOKIES); 33 net::LOAD_DO_NOT_SAVE_COOKIES);
34 fetcher_->SetAutomaticallyRetryOnNetworkChanges(kNumRetries); 34 fetcher_->SetAutomaticallyRetryOnNetworkChanges(kNumRetries);
35 fetcher_->SaveResponseToTemporaryFile( 35 fetcher_->SaveResponseToTemporaryFile(
36 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)); 36 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE));
37 37
38 if (overwrite) { 38 if (overwrite) {
39 fetcher_->Start(); 39 fetcher_->Start();
40 } else { 40 } else {
41 base::PostTaskAndReplyWithResult( 41 base::PostTaskAndReplyWithResult(
42 BrowserThread::GetBlockingPool() 42 BrowserThread::GetBlockingPool()
43 ->GetTaskRunnerWithShutdownBehavior( 43 ->GetTaskRunnerWithShutdownBehavior(
44 base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN) 44 base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN)
45 .get(), 45 .get(),
46 FROM_HERE, base::Bind(&base::PathExists, local_path_), 46 FROM_HERE, base::Bind(&base::PathExists, local_path_),
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 } 95 }
96 96
97 void FileDownloader::OnFileMoveDone(bool success) { 97 void FileDownloader::OnFileMoveDone(bool success) {
98 if (!success) { 98 if (!success) {
99 DLOG(WARNING) << "Could not move file to " 99 DLOG(WARNING) << "Could not move file to "
100 << local_path_.LossyDisplayName(); 100 << local_path_.LossyDisplayName();
101 } 101 }
102 102
103 callback_.Run(success ? DOWNLOADED : FAILED); 103 callback_.Run(success ? DOWNLOADED : FAILED);
104 } 104 }
OLDNEW
« no previous file with comments | « chrome/browser/net/chrome_url_request_context_getter.cc ('k') | chrome/browser/net/http_server_properties_manager_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698