| 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 // See net/disk_cache/disk_cache.h for the public interface of the cache. | 5 // See net/disk_cache/disk_cache.h for the public interface of the cache. |
| 6 | 6 |
| 7 #ifndef NET_DISK_CACHE_BACKEND_IMPL_H_ | 7 #ifndef NET_DISK_CACHE_BACKEND_IMPL_H_ |
| 8 #define NET_DISK_CACHE_BACKEND_IMPL_H_ | 8 #define NET_DISK_CACHE_BACKEND_IMPL_H_ |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 class NET_EXPORT_PRIVATE BackendImpl : public Backend { | 42 class NET_EXPORT_PRIVATE BackendImpl : public Backend { |
| 43 friend class Eviction; | 43 friend class Eviction; |
| 44 public: | 44 public: |
| 45 BackendImpl(const base::FilePath& path, base::MessageLoopProxy* cache_thread, | 45 BackendImpl(const base::FilePath& path, base::MessageLoopProxy* cache_thread, |
| 46 net::NetLog* net_log); | 46 net::NetLog* net_log); |
| 47 // mask can be used to limit the usable size of the hash table, for testing. | 47 // mask can be used to limit the usable size of the hash table, for testing. |
| 48 BackendImpl(const base::FilePath& path, uint32 mask, | 48 BackendImpl(const base::FilePath& path, uint32 mask, |
| 49 base::MessageLoopProxy* cache_thread, net::NetLog* net_log); | 49 base::MessageLoopProxy* cache_thread, net::NetLog* net_log); |
| 50 virtual ~BackendImpl(); | 50 virtual ~BackendImpl(); |
| 51 | 51 |
| 52 // Returns a new backend with the desired flags. See the declaration of | |
| 53 // CreateCacheBackend(). | |
| 54 static int CreateBackend(const base::FilePath& full_path, bool force, | |
| 55 int max_bytes, net::CacheType type, | |
| 56 uint32 flags, base::MessageLoopProxy* thread, | |
| 57 net::NetLog* net_log, Backend** backend, | |
| 58 const CompletionCallback& callback); | |
| 59 | |
| 60 // Performs general initialization for this current instance of the cache. | 52 // Performs general initialization for this current instance of the cache. |
| 61 int Init(const CompletionCallback& callback); | 53 int Init(const CompletionCallback& callback); |
| 62 | 54 |
| 63 // Performs the actual initialization and final cleanup on destruction. | 55 // Performs the actual initialization and final cleanup on destruction. |
| 64 int SyncInit(); | 56 int SyncInit(); |
| 65 void CleanupCache(); | 57 void CleanupCache(); |
| 66 | 58 |
| 67 // Same behavior as OpenNextEntry but walks the list from back to front. | 59 // Same behavior as OpenNextEntry but walks the list from back to front. |
| 68 int OpenPrevEntry(void** iter, Entry** prev_entry, | 60 int OpenPrevEntry(void** iter, Entry** prev_entry, |
| 69 const CompletionCallback& callback); | 61 const CompletionCallback& callback); |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 | 386 |
| 395 DISALLOW_COPY_AND_ASSIGN(BackendImpl); | 387 DISALLOW_COPY_AND_ASSIGN(BackendImpl); |
| 396 }; | 388 }; |
| 397 | 389 |
| 398 // Returns the preferred max cache size given the available disk space. | 390 // Returns the preferred max cache size given the available disk space. |
| 399 NET_EXPORT_PRIVATE int PreferedCacheSize(int64 available); | 391 NET_EXPORT_PRIVATE int PreferedCacheSize(int64 available); |
| 400 | 392 |
| 401 } // namespace disk_cache | 393 } // namespace disk_cache |
| 402 | 394 |
| 403 #endif // NET_DISK_CACHE_BACKEND_IMPL_H_ | 395 #endif // NET_DISK_CACHE_BACKEND_IMPL_H_ |
| OLD | NEW |