| OLD | NEW |
| 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" |
| 11 #include "base/threading/sequenced_worker_pool.h" |
| 11 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
| 12 #include "net/base/load_flags.h" | 13 #include "net/base/load_flags.h" |
| 13 #include "net/http/http_status_code.h" | 14 #include "net/http/http_status_code.h" |
| 14 #include "net/url_request/url_fetcher.h" | 15 #include "net/url_request/url_fetcher.h" |
| 15 #include "url/gurl.h" | 16 #include "url/gurl.h" |
| 16 | 17 |
| 17 using content::BrowserThread; | 18 using content::BrowserThread; |
| 18 using net::URLFetcher; | 19 using net::URLFetcher; |
| 19 | 20 |
| 20 const int kNumRetries = 1; | 21 const int kNumRetries = 1; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 } | 96 } |
| 96 | 97 |
| 97 void FileDownloader::OnFileMoveDone(bool success) { | 98 void FileDownloader::OnFileMoveDone(bool success) { |
| 98 if (!success) { | 99 if (!success) { |
| 99 DLOG(WARNING) << "Could not move file to " | 100 DLOG(WARNING) << "Could not move file to " |
| 100 << local_path_.LossyDisplayName(); | 101 << local_path_.LossyDisplayName(); |
| 101 } | 102 } |
| 102 | 103 |
| 103 callback_.Run(success ? DOWNLOADED : FAILED); | 104 callback_.Run(success ? DOWNLOADED : FAILED); |
| 104 } | 105 } |
| OLD | NEW |