| 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_BASE_FILE_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_BASE_FILE_H_ |
| 6 #define CONTENT_BROWSER_DOWNLOAD_BASE_FILE_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_BASE_FILE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 // Detach the file so it is not deleted on destruction. | 58 // Detach the file so it is not deleted on destruction. |
| 59 virtual void Detach(); | 59 virtual void Detach(); |
| 60 | 60 |
| 61 // Abort the download and automatically close the file. | 61 // Abort the download and automatically close the file. |
| 62 void Cancel(); | 62 void Cancel(); |
| 63 | 63 |
| 64 // Indicate that the download has finished. No new data will be received. | 64 // Indicate that the download has finished. No new data will be received. |
| 65 void Finish(); | 65 void Finish(); |
| 66 | 66 |
| 67 // Informs the OS that this file came from the internet. | 67 // Informs the OS that this file came from the internet. |
| 68 void AnnotateWithSourceInformation(); | 68 net::Error AnnotateWithSourceInformation(); |
| 69 | 69 |
| 70 // Calculate and return the current speed in bytes per second. | 70 // Calculate and return the current speed in bytes per second. |
| 71 int64 CurrentSpeed() const; | 71 int64 CurrentSpeed() const; |
| 72 | 72 |
| 73 FilePath full_path() const { return full_path_; } | 73 FilePath full_path() const { return full_path_; } |
| 74 bool in_progress() const { return file_stream_ != NULL; } | 74 bool in_progress() const { return file_stream_ != NULL; } |
| 75 int64 bytes_so_far() const { return bytes_so_far_; } | 75 int64 bytes_so_far() const { return bytes_so_far_; } |
| 76 | 76 |
| 77 // Fills |hash| with the hash digest for the file. | 77 // Fills |hash| with the hash digest for the file. |
| 78 // Returns true if digest is successfully calculated. | 78 // Returns true if digest is successfully calculated. |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 // Indicates that this class no longer owns the associated file, and so | 139 // Indicates that this class no longer owns the associated file, and so |
| 140 // won't delete it on destruction. | 140 // won't delete it on destruction. |
| 141 bool detached_; | 141 bool detached_; |
| 142 | 142 |
| 143 net::BoundNetLog bound_net_log_; | 143 net::BoundNetLog bound_net_log_; |
| 144 | 144 |
| 145 DISALLOW_COPY_AND_ASSIGN(BaseFile); | 145 DISALLOW_COPY_AND_ASSIGN(BaseFile); |
| 146 }; | 146 }; |
| 147 | 147 |
| 148 #endif // CONTENT_BROWSER_DOWNLOAD_BASE_FILE_H_ | 148 #endif // CONTENT_BROWSER_DOWNLOAD_BASE_FILE_H_ |
| OLD | NEW |