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 21 matching lines...) Expand all Loading... |
32 kUnitTestMode = 1 << 2, // We are modifying the behavior for testing. | 32 kUnitTestMode = 1 << 2, // We are modifying the behavior for testing. |
33 kUpgradeMode = 1 << 3, // This is the upgrade tool (dump). | 33 kUpgradeMode = 1 << 3, // This is the upgrade tool (dump). |
34 kNewEviction = 1 << 4, // Use of new eviction was specified. | 34 kNewEviction = 1 << 4, // Use of new eviction was specified. |
35 kNoRandom = 1 << 5, // Don't add randomness to the behavior. | 35 kNoRandom = 1 << 5, // Don't add randomness to the behavior. |
36 kNoLoadProtection = 1 << 6, // Don't act conservatively under load. | 36 kNoLoadProtection = 1 << 6, // Don't act conservatively under load. |
37 kNoBuffering = 1 << 7 // Disable extended IO buffering. | 37 kNoBuffering = 1 << 7 // Disable extended IO buffering. |
38 }; | 38 }; |
39 | 39 |
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_EXPORT_PRIVATE 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 virtual ~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 |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 base::RepeatingTimer<BackendImpl> timer_; // Usage timer. | 376 base::RepeatingTimer<BackendImpl> timer_; // Usage timer. |
377 base::WaitableEvent done_; // Signals the end of background work. | 377 base::WaitableEvent done_; // Signals the end of background work. |
378 scoped_refptr<TraceObject> trace_object_; // Inits internal tracing. | 378 scoped_refptr<TraceObject> trace_object_; // Inits internal tracing. |
379 ScopedRunnableMethodFactory<BackendImpl> factory_; | 379 ScopedRunnableMethodFactory<BackendImpl> factory_; |
380 base::WeakPtrFactory<BackendImpl> ptr_factory_; | 380 base::WeakPtrFactory<BackendImpl> ptr_factory_; |
381 | 381 |
382 DISALLOW_COPY_AND_ASSIGN(BackendImpl); | 382 DISALLOW_COPY_AND_ASSIGN(BackendImpl); |
383 }; | 383 }; |
384 | 384 |
385 // Returns the prefered max cache size given the available disk space. | 385 // Returns the prefered max cache size given the available disk space. |
386 NET_TEST int PreferedCacheSize(int64 available); | 386 NET_EXPORT_PRIVATE int PreferedCacheSize(int64 available); |
387 | 387 |
388 } // namespace disk_cache | 388 } // namespace disk_cache |
389 | 389 |
390 #endif // NET_DISK_CACHE_BACKEND_IMPL_H_ | 390 #endif // NET_DISK_CACHE_BACKEND_IMPL_H_ |
OLD | NEW |