| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // Defines the public interface of the disk cache. For more details see | 5 // Defines the public interface of the disk cache. For more details see |
| 6 // http://dev.chromium.org/developers/design-documents/disk-cache | 6 // http://dev.chromium.org/developers/design-documents/disk-cache |
| 7 | 7 |
| 8 #ifndef NET_DISK_CACHE_DISK_CACHE_H_ | 8 #ifndef NET_DISK_CACHE_DISK_CACHE_H_ |
| 9 #define NET_DISK_CACHE_DISK_CACHE_H_ | 9 #define NET_DISK_CACHE_DISK_CACHE_H_ |
| 10 | 10 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 // With a stream prepared as an external file, the stream would always be | 165 // With a stream prepared as an external file, the stream would always be |
| 166 // kept in an external file since creation, even if the stream has 0 bytes. | 166 // kept in an external file since creation, even if the stream has 0 bytes. |
| 167 // So we need to be cautious about using this option for preparing a stream or | 167 // So we need to be cautious about using this option for preparing a stream or |
| 168 // we will end up having a lot of empty cache files. Calling this method also | 168 // we will end up having a lot of empty cache files. Calling this method also |
| 169 // means that all data written to the stream will always be written to file | 169 // means that all data written to the stream will always be written to file |
| 170 // directly *without* buffering. | 170 // directly *without* buffering. |
| 171 virtual base::PlatformFile UseExternalFile(int index) = 0; | 171 virtual base::PlatformFile UseExternalFile(int index) = 0; |
| 172 | 172 |
| 173 // Returns an asynchronous read file handle for the cache stream referenced by | 173 // Returns an asynchronous read file handle for the cache stream referenced by |
| 174 // |index|. Values other than base::kInvalidPlatformFileValue are successful | 174 // |index|. Values other than base::kInvalidPlatformFileValue are successful |
| 175 // and the file handle should be managed by the caller, i.e. caller should | 175 // and the file handle should be managed by the caller, i.e. the caller should |
| 176 // close the handle after use or there will be a leak. | 176 // close the handle after use or there will be a leak. |
| 177 virtual base::PlatformFile GetPlatformFile(int index) = 0; | 177 virtual base::PlatformFile GetPlatformFile(int index) = 0; |
| 178 | 178 |
| 179 protected: | 179 protected: |
| 180 virtual ~Entry() {} | 180 virtual ~Entry() {} |
| 181 }; | 181 }; |
| 182 | 182 |
| 183 } // namespace disk_cache | 183 } // namespace disk_cache |
| 184 | 184 |
| 185 #endif // NET_DISK_CACHE_DISK_CACHE_H_ | 185 #endif // NET_DISK_CACHE_DISK_CACHE_H_ |
| OLD | NEW |