Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: net/disk_cache/disk_cache.h

Issue 12794003: Initialize the simple cache backend at runtime. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 // A version of the above with additional |flags| allowing more fine-tuned
58 // testing.
59 NET_EXPORT int CreateCacheBackendWithFlags(
rvargas (doing something else) 2013/03/18 22:25:25 Regardless of the file, the correct declaration wo
60 net::CacheType type,
61 const base::FilePath& path,
62 int max_bytes,
63 bool force,
64 uint32 flags,
65 base::MessageLoopProxy* thread,
66 net::NetLog* net_log,
67 Backend** backend,
68 const net::CompletionCallback& callback);
69
70 // Renames cache directory synchronously and fires off a background cleanup
71 // task. Used by cache creator itself or by backends for self-restart on error.
72 bool DelayedCacheCleanup(const base::FilePath& full_path);
73
57 // The root interface for a disk cache instance. 74 // The root interface for a disk cache instance.
58 class NET_EXPORT Backend { 75 class NET_EXPORT Backend {
59 public: 76 public:
60 typedef net::CompletionCallback CompletionCallback; 77 typedef net::CompletionCallback CompletionCallback;
61 78
62 // If the backend is destroyed when there are operations in progress (any 79 // If the backend is destroyed when there are operations in progress (any
63 // callback that has not been invoked yet), this method cancels said 80 // callback that has not been invoked yet), this method cancels said
64 // operations so the callbacks are not invoked, possibly leaving the work 81 // 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 82 // 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 83 // 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
302 // Note: This method is deprecated. 319 // Note: This method is deprecated.
303 virtual int ReadyForSparseIO(const CompletionCallback& callback) = 0; 320 virtual int ReadyForSparseIO(const CompletionCallback& callback) = 0;
304 321
305 protected: 322 protected:
306 virtual ~Entry() {} 323 virtual ~Entry() {}
307 }; 324 };
308 325
309 } // namespace disk_cache 326 } // namespace disk_cache
310 327
311 #endif // NET_DISK_CACHE_DISK_CACHE_H_ 328 #endif // NET_DISK_CACHE_DISK_CACHE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698