Chromium Code Reviews| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 104 std::unique_ptr<ByteStreamReader> byte_stream, | 104 std::unique_ptr<ByteStreamReader> byte_stream, |
| 105 const net::NetLogWithSource& net_log, | 105 const net::NetLogWithSource& net_log, |
| 106 base::WeakPtr<DownloadDestinationObserver> observer, | 106 base::WeakPtr<DownloadDestinationObserver> observer, |
| 107 const TestFileErrorInjector::FileErrorInfo& error_info, | 107 const TestFileErrorInjector::FileErrorInfo& error_info, |
| 108 const base::Closure& ctor_callback, | 108 const base::Closure& ctor_callback, |
| 109 const base::Closure& dtor_callback) | 109 const base::Closure& dtor_callback) |
| 110 : DownloadFileImpl(std::move(save_info), | 110 : DownloadFileImpl(std::move(save_info), |
| 111 default_download_directory, | 111 default_download_directory, |
| 112 std::move(byte_stream), | 112 std::move(byte_stream), |
| 113 net_log, | 113 net_log, |
| 114 false, | |
|
alexmos
2017/03/02 21:45:14
nit: consider adding /* is_sparse_file */ for read
xingliu
2017/03/02 23:06:15
Done.
| |
| 114 observer), | 115 observer), |
| 115 error_info_(error_info), | 116 error_info_(error_info), |
| 116 destruction_callback_(dtor_callback) { | 117 destruction_callback_(dtor_callback) { |
| 117 // DownloadFiles are created on the UI thread and are destroyed on the FILE | 118 // DownloadFiles are created on the UI thread and are destroyed on the FILE |
| 118 // thread. Schedule the ConstructionCallback on the FILE thread so that if a | 119 // thread. Schedule the ConstructionCallback on the FILE thread so that if a |
| 119 // DownloadItem schedules a DownloadFile to be destroyed and creates another | 120 // DownloadItem schedules a DownloadFile to be destroyed and creates another |
| 120 // one (as happens during download resumption), then the DestructionCallback | 121 // one (as happens during download resumption), then the DestructionCallback |
| 121 // for the old DownloadFile is run before the ConstructionCallback for the | 122 // for the old DownloadFile is run before the ConstructionCallback for the |
| 122 // next DownloadFile. | 123 // next DownloadFile. |
| 123 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, ctor_callback); | 124 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, ctor_callback); |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 403 case FILE_OPERATION_RENAME_ANNOTATE: | 404 case FILE_OPERATION_RENAME_ANNOTATE: |
| 404 return "RENAME_ANNOTATE"; | 405 return "RENAME_ANNOTATE"; |
| 405 default: | 406 default: |
| 406 break; | 407 break; |
| 407 } | 408 } |
| 408 | 409 |
| 409 return "Unknown"; | 410 return "Unknown"; |
| 410 } | 411 } |
| 411 | 412 |
| 412 } // namespace content | 413 } // namespace content |
| OLD | NEW |