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 // 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/network-stack/disk-cache | 6 // http://dev.chromium.org/developers/design-documents/network-stack/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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
47 // be invoked when a backend is available or a fatal error condition is reached. | 47 // be invoked when a backend is available or a fatal error condition is reached. |
48 // The pointer to receive the |backend| must remain valid until the operation | 48 // The pointer to receive the |backend| must remain valid until the operation |
49 // completes (the callback is notified). | 49 // completes (the callback is notified). |
50 NET_EXPORT int CreateCacheBackend(net::CacheType type, | 50 NET_EXPORT int CreateCacheBackend(net::CacheType type, |
51 const base::FilePath& path, | 51 const base::FilePath& path, |
52 int max_bytes, bool force, | 52 int max_bytes, bool force, |
53 base::MessageLoopProxy* thread, | 53 base::MessageLoopProxy* thread, |
54 net::NetLog* net_log, Backend** backend, | 54 net::NetLog* net_log, Backend** backend, |
55 const net::CompletionCallback& callback); | 55 const net::CompletionCallback& callback); |
56 | 56 |
57 // Renames cache directory synchronously and fires off a background cleanup | |
58 // task. Used by cache creator itself or by backends for self-restart on error. | |
59 bool DelayedCacheCleanup(const base::FilePath& full_path); | |
rvargas (doing something else)
2013/03/25 22:06:04
move this to cache_util.h
pasko-google - do not use
2013/03/26 16:54:57
Done.
| |
60 | |
57 // The root interface for a disk cache instance. | 61 // The root interface for a disk cache instance. |
58 class NET_EXPORT Backend { | 62 class NET_EXPORT Backend { |
59 public: | 63 public: |
60 typedef net::CompletionCallback CompletionCallback; | 64 typedef net::CompletionCallback CompletionCallback; |
61 | 65 |
62 // If the backend is destroyed when there are operations in progress (any | 66 // If the backend is destroyed when there are operations in progress (any |
63 // callback that has not been invoked yet), this method cancels said | 67 // callback that has not been invoked yet), this method cancels said |
64 // operations so the callbacks are not invoked, possibly leaving the work | 68 // operations so the callbacks are not invoked, possibly leaving the work |
65 // half way (for instance, dooming just a few entries). Note that pending IO | 69 // half way (for instance, dooming just a few entries). Note that pending IO |
66 // for a given Entry (as opposed to the Backend) will still generate a | 70 // for a given Entry (as opposed to the Backend) will still generate a |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
302 // Note: This method is deprecated. | 306 // Note: This method is deprecated. |
303 virtual int ReadyForSparseIO(const CompletionCallback& callback) = 0; | 307 virtual int ReadyForSparseIO(const CompletionCallback& callback) = 0; |
304 | 308 |
305 protected: | 309 protected: |
306 virtual ~Entry() {} | 310 virtual ~Entry() {} |
307 }; | 311 }; |
308 | 312 |
309 } // namespace disk_cache | 313 } // namespace disk_cache |
310 | 314 |
311 #endif // NET_DISK_CACHE_DISK_CACHE_H_ | 315 #endif // NET_DISK_CACHE_DISK_CACHE_H_ |
OLD | NEW |