| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/public/test/test_file_error_injector.h" | 5 #include "content/public/test/test_file_error_injector.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 const net::NetLogWithSource& net_log, | 110 const net::NetLogWithSource& net_log, |
| 111 base::WeakPtr<DownloadDestinationObserver> observer, | 111 base::WeakPtr<DownloadDestinationObserver> observer, |
| 112 const TestFileErrorInjector::FileErrorInfo& error_info, | 112 const TestFileErrorInjector::FileErrorInfo& error_info, |
| 113 const base::Closure& ctor_callback, | 113 const base::Closure& ctor_callback, |
| 114 const base::Closure& dtor_callback) | 114 const base::Closure& dtor_callback) |
| 115 : DownloadFileImpl(std::move(save_info), | 115 : DownloadFileImpl(std::move(save_info), |
| 116 default_download_directory, | 116 default_download_directory, |
| 117 std::move(byte_stream), | 117 std::move(byte_stream), |
| 118 received_slices, | 118 received_slices, |
| 119 net_log, | 119 net_log, |
| 120 false, /* is_sparse_file */ | |
| 121 observer), | 120 observer), |
| 122 error_info_(error_info), | 121 error_info_(error_info), |
| 123 destruction_callback_(dtor_callback) { | 122 destruction_callback_(dtor_callback) { |
| 124 // DownloadFiles are created on the UI thread and are destroyed on the FILE | 123 // DownloadFiles are created on the UI thread and are destroyed on the FILE |
| 125 // thread. Schedule the ConstructionCallback on the FILE thread so that if a | 124 // thread. Schedule the ConstructionCallback on the FILE thread so that if a |
| 126 // DownloadItem schedules a DownloadFile to be destroyed and creates another | 125 // DownloadItem schedules a DownloadFile to be destroyed and creates another |
| 127 // one (as happens during download resumption), then the DestructionCallback | 126 // one (as happens during download resumption), then the DestructionCallback |
| 128 // for the old DownloadFile is run before the ConstructionCallback for the | 127 // for the old DownloadFile is run before the ConstructionCallback for the |
| 129 // next DownloadFile. | 128 // next DownloadFile. |
| 130 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, ctor_callback); | 129 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, ctor_callback); |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 case FILE_OPERATION_RENAME_ANNOTATE: | 414 case FILE_OPERATION_RENAME_ANNOTATE: |
| 416 return "RENAME_ANNOTATE"; | 415 return "RENAME_ANNOTATE"; |
| 417 default: | 416 default: |
| 418 break; | 417 break; |
| 419 } | 418 } |
| 420 | 419 |
| 421 return "Unknown"; | 420 return "Unknown"; |
| 422 } | 421 } |
| 423 | 422 |
| 424 } // namespace content | 423 } // namespace content |
| OLD | NEW |