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_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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
12 #include "base/memory/linked_ptr.h" | 12 #include "base/memory/linked_ptr.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "content/browser/power_save_blocker.h" | 14 #include "content/browser/power_save_blocker.h" |
| 15 #include "content/common/content_export.h" |
15 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
16 #include "net/base/net_errors.h" | 17 #include "net/base/net_errors.h" |
17 | 18 |
18 namespace crypto { | 19 namespace crypto { |
19 class SecureHash; | 20 class SecureHash; |
20 } | 21 } |
21 namespace net { | 22 namespace net { |
22 class FileStream; | 23 class FileStream; |
23 } | 24 } |
24 | 25 |
25 // File being downloaded and saved to disk. This is a base class | 26 // File being downloaded and saved to disk. This is a base class |
26 // for DownloadFile and SaveFile, which keep more state information. | 27 // for DownloadFile and SaveFile, which keep more state information. |
27 class BaseFile { | 28 class CONTENT_EXPORT BaseFile { |
28 public: | 29 public: |
29 BaseFile(const FilePath& full_path, | 30 BaseFile(const FilePath& full_path, |
30 const GURL& source_url, | 31 const GURL& source_url, |
31 const GURL& referrer_url, | 32 const GURL& referrer_url, |
32 int64 received_bytes, | 33 int64 received_bytes, |
33 const linked_ptr<net::FileStream>& file_stream); | 34 const linked_ptr<net::FileStream>& file_stream); |
34 virtual ~BaseFile(); | 35 virtual ~BaseFile(); |
35 | 36 |
36 // If calculate_hash is true, sha256 hash will be calculated. | 37 // If calculate_hash is true, sha256 hash will be calculated. |
37 // Returns net::OK on success, or a network error code on failure. | 38 // Returns net::OK on success, or a network error code on failure. |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 unsigned char sha256_hash_[kSha256HashLen]; | 109 unsigned char sha256_hash_[kSha256HashLen]; |
109 | 110 |
110 // Indicates that this class no longer owns the associated file, and so | 111 // Indicates that this class no longer owns the associated file, and so |
111 // won't delete it on destruction. | 112 // won't delete it on destruction. |
112 bool detached_; | 113 bool detached_; |
113 | 114 |
114 DISALLOW_COPY_AND_ASSIGN(BaseFile); | 115 DISALLOW_COPY_AND_ASSIGN(BaseFile); |
115 }; | 116 }; |
116 | 117 |
117 #endif // CONTENT_BROWSER_DOWNLOAD_BASE_FILE_H_ | 118 #endif // CONTENT_BROWSER_DOWNLOAD_BASE_FILE_H_ |
OLD | NEW |