| 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 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 virtual std::string DebugString() const; | 65 virtual std::string DebugString() const; |
| 66 | 66 |
| 67 protected: | 67 protected: |
| 68 bool Open(); | 68 bool Open(); |
| 69 void Close(); | 69 void Close(); |
| 70 | 70 |
| 71 // Full path to the file including the file name. | 71 // Full path to the file including the file name. |
| 72 FilePath full_path_; | 72 FilePath full_path_; |
| 73 | 73 |
| 74 private: | 74 private: |
| 75 friend class BaseFileTest; |
| 76 |
| 75 static const size_t kSha256HashLen = 32; | 77 static const size_t kSha256HashLen = 32; |
| 76 | 78 |
| 77 // Source URL for the file being downloaded. | 79 // Source URL for the file being downloaded. |
| 78 GURL source_url_; | 80 GURL source_url_; |
| 79 | 81 |
| 80 // The URL where the download was initiated. | 82 // The URL where the download was initiated. |
| 81 GURL referrer_url_; | 83 GURL referrer_url_; |
| 82 | 84 |
| 83 // OS file stream for writing | 85 // OS file stream for writing |
| 84 linked_ptr<net::FileStream> file_stream_; | 86 linked_ptr<net::FileStream> file_stream_; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 99 unsigned char sha256_hash_[kSha256HashLen]; | 101 unsigned char sha256_hash_[kSha256HashLen]; |
| 100 | 102 |
| 101 // Indicates that this class no longer owns the associated file, and so | 103 // Indicates that this class no longer owns the associated file, and so |
| 102 // won't delete it on destruction. | 104 // won't delete it on destruction. |
| 103 bool detached_; | 105 bool detached_; |
| 104 | 106 |
| 105 DISALLOW_COPY_AND_ASSIGN(BaseFile); | 107 DISALLOW_COPY_AND_ASSIGN(BaseFile); |
| 106 }; | 108 }; |
| 107 | 109 |
| 108 #endif // CONTENT_BROWSER_DOWNLOAD_BASE_FILE_H_ | 110 #endif // CONTENT_BROWSER_DOWNLOAD_BASE_FILE_H_ |
| OLD | NEW |