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 11 matching lines...) Expand all Loading... |
22 class SecureHash; | 22 class SecureHash; |
23 } | 23 } |
24 namespace net { | 24 namespace net { |
25 class FileStream; | 25 class FileStream; |
26 } | 26 } |
27 | 27 |
28 // File being downloaded and saved to disk. This is a base class | 28 // File being downloaded and saved to disk. This is a base class |
29 // for DownloadFile and SaveFile, which keep more state information. | 29 // for DownloadFile and SaveFile, which keep more state information. |
30 class CONTENT_EXPORT BaseFile { | 30 class CONTENT_EXPORT BaseFile { |
31 public: | 31 public: |
| 32 // May be constructed on any thread. All other routines (including |
| 33 // destruction) must occur on the FILE thread. |
32 BaseFile(const FilePath& full_path, | 34 BaseFile(const FilePath& full_path, |
33 const GURL& source_url, | 35 const GURL& source_url, |
34 const GURL& referrer_url, | 36 const GURL& referrer_url, |
35 int64 received_bytes, | 37 int64 received_bytes, |
36 bool calculate_hash, | 38 bool calculate_hash, |
37 const std::string& hash_state, | 39 const std::string& hash_state, |
38 const linked_ptr<net::FileStream>& file_stream, | 40 const linked_ptr<net::FileStream>& file_stream, |
39 const net::BoundNetLog& bound_net_log); | 41 const net::BoundNetLog& bound_net_log); |
40 virtual ~BaseFile(); | 42 virtual ~BaseFile(); |
41 | 43 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // Indicates that this class no longer owns the associated file, and so | 137 // Indicates that this class no longer owns the associated file, and so |
136 // won't delete it on destruction. | 138 // won't delete it on destruction. |
137 bool detached_; | 139 bool detached_; |
138 | 140 |
139 net::BoundNetLog bound_net_log_; | 141 net::BoundNetLog bound_net_log_; |
140 | 142 |
141 DISALLOW_COPY_AND_ASSIGN(BaseFile); | 143 DISALLOW_COPY_AND_ASSIGN(BaseFile); |
142 }; | 144 }; |
143 | 145 |
144 #endif // CONTENT_BROWSER_DOWNLOAD_BASE_FILE_H_ | 146 #endif // CONTENT_BROWSER_DOWNLOAD_BASE_FILE_H_ |
OLD | NEW |