| 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 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_ |
| 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_ |
| 7 | 7 |
| 8 #include "content/browser/download/download_file.h" | 8 #include "content/browser/download/download_file.h" |
| 9 | 9 |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 // Called before the data is written to disk. | 176 // Called before the data is written to disk. |
| 177 void WillWriteToDisk(size_t data_len); | 177 void WillWriteToDisk(size_t data_len); |
| 178 | 178 |
| 179 // Called when there's some activity on the byte stream that needs to be | 179 // Called when there's some activity on the byte stream that needs to be |
| 180 // handled. | 180 // handled. |
| 181 void StreamActive(SourceStream* source_stream); | 181 void StreamActive(SourceStream* source_stream); |
| 182 | 182 |
| 183 // Register callback and start to read data from the stream. | 183 // Register callback and start to read data from the stream. |
| 184 void RegisterAndActivateStream(SourceStream* source_stream); | 184 void RegisterAndActivateStream(SourceStream* source_stream); |
| 185 | 185 |
| 186 // Check if download is completed. |
| 187 bool IsDownloadCompleted(); |
| 188 |
| 186 // Return the total valid bytes received in the target file. | 189 // Return the total valid bytes received in the target file. |
| 187 // If the file is a sparse file, return the total number of valid bytes. | 190 // If the file is a sparse file, return the total number of valid bytes. |
| 188 // Otherwise, return the current file size. | 191 // Otherwise, return the current file size. |
| 189 int64_t TotalBytesReceived() const; | 192 int64_t TotalBytesReceived() const; |
| 190 | 193 |
| 191 net::NetLogWithSource net_log_; | 194 net::NetLogWithSource net_log_; |
| 192 | 195 |
| 193 // The base file instance. | 196 // The base file instance. |
| 194 BaseFile file_; | 197 BaseFile file_; |
| 195 | 198 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 | 231 |
| 229 base::WeakPtr<DownloadDestinationObserver> observer_; | 232 base::WeakPtr<DownloadDestinationObserver> observer_; |
| 230 base::WeakPtrFactory<DownloadFileImpl> weak_factory_; | 233 base::WeakPtrFactory<DownloadFileImpl> weak_factory_; |
| 231 | 234 |
| 232 DISALLOW_COPY_AND_ASSIGN(DownloadFileImpl); | 235 DISALLOW_COPY_AND_ASSIGN(DownloadFileImpl); |
| 233 }; | 236 }; |
| 234 | 237 |
| 235 } // namespace content | 238 } // namespace content |
| 236 | 239 |
| 237 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_ | 240 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_ |
| OLD | NEW |