| 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 // 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 #pragma once | 9 #pragma once |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 // This class implements the Backend interface. An object of this | 40 // This class implements the Backend interface. An object of this |
| 41 // class handles the operations of the cache for a particular profile. | 41 // class handles the operations of the cache for a particular profile. |
| 42 class NET_TEST BackendImpl : public Backend { | 42 class NET_TEST BackendImpl : public Backend { |
| 43 friend class Eviction; | 43 friend class Eviction; |
| 44 public: | 44 public: |
| 45 BackendImpl(const FilePath& path, base::MessageLoopProxy* cache_thread, | 45 BackendImpl(const 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 FilePath& path, uint32 mask, | 48 BackendImpl(const FilePath& path, uint32 mask, |
| 49 base::MessageLoopProxy* cache_thread, net::NetLog* net_log); | 49 base::MessageLoopProxy* cache_thread, net::NetLog* net_log); |
| 50 ~BackendImpl(); | 50 virtual ~BackendImpl(); |
| 51 | 51 |
| 52 // Returns a new backend with the desired flags. See the declaration of | 52 // Returns a new backend with the desired flags. See the declaration of |
| 53 // CreateCacheBackend(). | 53 // CreateCacheBackend(). |
| 54 static int CreateBackend(const FilePath& full_path, bool force, | 54 static int CreateBackend(const FilePath& full_path, bool force, |
| 55 int max_bytes, net::CacheType type, | 55 int max_bytes, net::CacheType type, |
| 56 uint32 flags, base::MessageLoopProxy* thread, | 56 uint32 flags, base::MessageLoopProxy* thread, |
| 57 net::NetLog* net_log, Backend** backend, | 57 net::NetLog* net_log, Backend** backend, |
| 58 CompletionCallback* callback); | 58 CompletionCallback* callback); |
| 59 | 59 |
| 60 // Performs general initialization for this current instance of the cache. | 60 // Performs general initialization for this current instance of the cache. |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 | 379 |
| 380 DISALLOW_COPY_AND_ASSIGN(BackendImpl); | 380 DISALLOW_COPY_AND_ASSIGN(BackendImpl); |
| 381 }; | 381 }; |
| 382 | 382 |
| 383 // Returns the prefered max cache size given the available disk space. | 383 // Returns the prefered max cache size given the available disk space. |
| 384 NET_TEST int PreferedCacheSize(int64 available); | 384 NET_TEST int PreferedCacheSize(int64 available); |
| 385 | 385 |
| 386 } // namespace disk_cache | 386 } // namespace disk_cache |
| 387 | 387 |
| 388 #endif // NET_DISK_CACHE_BACKEND_IMPL_H_ | 388 #endif // NET_DISK_CACHE_BACKEND_IMPL_H_ |
| OLD | NEW |