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. | |
34 BaseFile(const FilePath& full_path, | 32 BaseFile(const FilePath& full_path, |
35 const GURL& source_url, | 33 const GURL& source_url, |
36 const GURL& referrer_url, | 34 const GURL& referrer_url, |
37 int64 received_bytes, | 35 int64 received_bytes, |
38 bool calculate_hash, | 36 bool calculate_hash, |
39 const std::string& hash_state, | 37 const std::string& hash_state, |
40 const linked_ptr<net::FileStream>& file_stream, | 38 const linked_ptr<net::FileStream>& file_stream, |
41 const net::BoundNetLog& bound_net_log); | 39 const net::BoundNetLog& bound_net_log); |
42 virtual ~BaseFile(); | 40 virtual ~BaseFile(); |
43 | 41 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 // Indicates that this class no longer owns the associated file, and so | 135 // Indicates that this class no longer owns the associated file, and so |
138 // won't delete it on destruction. | 136 // won't delete it on destruction. |
139 bool detached_; | 137 bool detached_; |
140 | 138 |
141 net::BoundNetLog bound_net_log_; | 139 net::BoundNetLog bound_net_log_; |
142 | 140 |
143 DISALLOW_COPY_AND_ASSIGN(BaseFile); | 141 DISALLOW_COPY_AND_ASSIGN(BaseFile); |
144 }; | 142 }; |
145 | 143 |
146 #endif // CONTENT_BROWSER_DOWNLOAD_BASE_FILE_H_ | 144 #endif // CONTENT_BROWSER_DOWNLOAD_BASE_FILE_H_ |
OLD | NEW |