OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_ITEM_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ |
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 virtual void SetPathUniquifier(int uniquifier) OVERRIDE; | 95 virtual void SetPathUniquifier(int uniquifier) OVERRIDE; |
96 virtual const GURL& GetURL() const OVERRIDE; | 96 virtual const GURL& GetURL() const OVERRIDE; |
97 virtual const std::vector<GURL>& GetUrlChain() const OVERRIDE; | 97 virtual const std::vector<GURL>& GetUrlChain() const OVERRIDE; |
98 virtual const GURL& GetOriginalUrl() const OVERRIDE; | 98 virtual const GURL& GetOriginalUrl() const OVERRIDE; |
99 virtual const GURL& GetReferrerUrl() const OVERRIDE; | 99 virtual const GURL& GetReferrerUrl() const OVERRIDE; |
100 virtual std::string GetSuggestedFilename() const OVERRIDE; | 100 virtual std::string GetSuggestedFilename() const OVERRIDE; |
101 virtual std::string GetContentDisposition() const OVERRIDE; | 101 virtual std::string GetContentDisposition() const OVERRIDE; |
102 virtual std::string GetMimeType() const OVERRIDE; | 102 virtual std::string GetMimeType() const OVERRIDE; |
103 virtual std::string GetOriginalMimeType() const OVERRIDE; | 103 virtual std::string GetOriginalMimeType() const OVERRIDE; |
104 virtual std::string GetReferrerCharset() const OVERRIDE; | 104 virtual std::string GetReferrerCharset() const OVERRIDE; |
| 105 virtual std::string GetRemoteAddress() const OVERRIDE; |
105 virtual int64 GetTotalBytes() const OVERRIDE; | 106 virtual int64 GetTotalBytes() const OVERRIDE; |
106 virtual void SetTotalBytes(int64 total_bytes) OVERRIDE; | 107 virtual void SetTotalBytes(int64 total_bytes) OVERRIDE; |
107 virtual const std::string& GetHash() const OVERRIDE; | 108 virtual const std::string& GetHash() const OVERRIDE; |
108 virtual int64 GetReceivedBytes() const OVERRIDE; | 109 virtual int64 GetReceivedBytes() const OVERRIDE; |
109 virtual int32 GetId() const OVERRIDE; | 110 virtual int32 GetId() const OVERRIDE; |
110 virtual DownloadId GetGlobalId() const OVERRIDE; | 111 virtual DownloadId GetGlobalId() const OVERRIDE; |
111 virtual base::Time GetStartTime() const OVERRIDE; | 112 virtual base::Time GetStartTime() const OVERRIDE; |
112 virtual base::Time GetEndTime() const OVERRIDE; | 113 virtual base::Time GetEndTime() const OVERRIDE; |
113 virtual void SetDbHandle(int64 handle) OVERRIDE; | 114 virtual void SetDbHandle(int64 handle) OVERRIDE; |
114 virtual int64 GetDbHandle() const OVERRIDE; | 115 virtual int64 GetDbHandle() const OVERRIDE; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 | 204 |
204 // The value of the content type header sent with the downloaded item. It | 205 // The value of the content type header sent with the downloaded item. It |
205 // may be different from |mime_type_|, which may be set based on heuristics | 206 // may be different from |mime_type_|, which may be set based on heuristics |
206 // which may look at the file extension and first few bytes of the file. | 207 // which may look at the file extension and first few bytes of the file. |
207 std::string original_mime_type_; | 208 std::string original_mime_type_; |
208 | 209 |
209 // The charset of the referring page where the download request comes from. | 210 // The charset of the referring page where the download request comes from. |
210 // It's used to construct a suggested filename. | 211 // It's used to construct a suggested filename. |
211 std::string referrer_charset_; | 212 std::string referrer_charset_; |
212 | 213 |
| 214 // The remote IP address where the download was fetched from. Copied from |
| 215 // DownloadCreateInfo::remote_address. |
| 216 std::string remote_address_; |
| 217 |
213 // Total bytes expected | 218 // Total bytes expected |
214 int64 total_bytes_; | 219 int64 total_bytes_; |
215 | 220 |
216 // Current received bytes | 221 // Current received bytes |
217 int64 received_bytes_; | 222 int64 received_bytes_; |
218 | 223 |
219 // Current speed. Calculated by the DownloadFile. | 224 // Current speed. Calculated by the DownloadFile. |
220 int64 bytes_per_sec_; | 225 int64 bytes_per_sec_; |
221 | 226 |
222 // Sha256 hash of the content. This might be empty either because | 227 // Sha256 hash of the content. This might be empty either because |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 // only. | 290 // only. |
286 bool open_enabled_; | 291 bool open_enabled_; |
287 | 292 |
288 // Did the delegate delay calling Complete on this download? | 293 // Did the delegate delay calling Complete on this download? |
289 bool delegate_delayed_complete_; | 294 bool delegate_delayed_complete_; |
290 | 295 |
291 DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl); | 296 DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl); |
292 }; | 297 }; |
293 | 298 |
294 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ | 299 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ |
OLD | NEW |