Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Side by Side Diff: content/browser/download/base_file.h

Issue 14697023: downloads: Improve download rate estimation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comment typo Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // Abort the download and automatically close the file. 66 // Abort the download and automatically close the file.
67 void Cancel(); 67 void Cancel();
68 68
69 // Indicate that the download has finished. No new data will be received. 69 // Indicate that the download has finished. No new data will be received.
70 void Finish(); 70 void Finish();
71 71
72 // Informs the OS that this file came from the internet. Returns a 72 // Informs the OS that this file came from the internet. Returns a
73 // DownloadInterruptReason indicating the result of the operation. 73 // DownloadInterruptReason indicating the result of the operation.
74 DownloadInterruptReason AnnotateWithSourceInformation(); 74 DownloadInterruptReason AnnotateWithSourceInformation();
75 75
76 // Calculate and return the current speed in bytes per second.
77 int64 CurrentSpeed() const;
78
79 base::FilePath full_path() const { return full_path_; } 76 base::FilePath full_path() const { return full_path_; }
80 bool in_progress() const { return file_stream_.get() != NULL; } 77 bool in_progress() const { return file_stream_.get() != NULL; }
81 int64 bytes_so_far() const { return bytes_so_far_; } 78 int64 bytes_so_far() const { return bytes_so_far_; }
82 79
83 // Fills |hash| with the hash digest for the file. 80 // Fills |hash| with the hash digest for the file.
84 // Returns true if digest is successfully calculated. 81 // Returns true if digest is successfully calculated.
85 virtual bool GetHash(std::string* hash); 82 virtual bool GetHash(std::string* hash);
86 83
87 // Returns the current (intermediate) state of the hash as a byte string. 84 // Returns the current (intermediate) state of the hash as a byte string.
88 virtual std::string GetHashState(); 85 virtual std::string GetHashState();
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 bool detached_; 165 bool detached_;
169 166
170 net::BoundNetLog bound_net_log_; 167 net::BoundNetLog bound_net_log_;
171 168
172 DISALLOW_COPY_AND_ASSIGN(BaseFile); 169 DISALLOW_COPY_AND_ASSIGN(BaseFile);
173 }; 170 };
174 171
175 } // namespace content 172 } // namespace content
176 173
177 #endif // CONTENT_BROWSER_DOWNLOAD_BASE_FILE_H_ 174 #endif // CONTENT_BROWSER_DOWNLOAD_BASE_FILE_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/download/base_file.cc » ('j') | content/browser/download/rate_estimator.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698