| 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_TYPES_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_TYPES_H_ |
| 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_TYPES_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_TYPES_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/memory/linked_ptr.h" | 10 #include "base/memory/linked_ptr.h" |
| 11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 12 #include "net/base/file_stream.h" | 12 #include "net/base/file_stream.h" |
| 13 | 13 |
| 14 // Holds the information about how to save a download file. | 14 // Holds the information about how to save a download file. |
| 15 // In the case of download continuation, |file_path| is set to the current file |
| 16 // name, |offset| is set to the point where we left off, and |hash_state| will |
| 17 // hold the state of the hash algorithm where we left off. |
| 15 struct CONTENT_EXPORT DownloadSaveInfo { | 18 struct CONTENT_EXPORT DownloadSaveInfo { |
| 16 DownloadSaveInfo(); | 19 DownloadSaveInfo(); |
| 17 DownloadSaveInfo(const DownloadSaveInfo& info); | 20 DownloadSaveInfo(const DownloadSaveInfo& info); |
| 18 ~DownloadSaveInfo(); | 21 ~DownloadSaveInfo(); |
| 19 DownloadSaveInfo& operator=(const DownloadSaveInfo& info); | 22 DownloadSaveInfo& operator=(const DownloadSaveInfo& info); |
| 20 | 23 |
| 24 // This is usually the tentative final name, but not during resumption |
| 25 // where it will be the intermediate file name. |
| 21 FilePath file_path; | 26 FilePath file_path; |
| 27 |
| 22 linked_ptr<net::FileStream> file_stream; | 28 linked_ptr<net::FileStream> file_stream; |
| 29 |
| 23 string16 suggested_name; | 30 string16 suggested_name; |
| 31 |
| 32 // The file offset at which to start the download. May be 0. |
| 33 int64 offset; |
| 34 |
| 35 // The state of the hash at the start of the download. May be empty. |
| 36 std::string hash_state; |
| 24 }; | 37 }; |
| 25 | 38 |
| 26 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_TYPES_H_ | 39 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_TYPES_H_ |
| OLD | NEW |