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_MEM_BACKEND_IMPL_H__ | 7 #ifndef NET_DISK_CACHE_MEM_BACKEND_IMPL_H__ |
8 #define NET_DISK_CACHE_MEM_BACKEND_IMPL_H__ | 8 #define NET_DISK_CACHE_MEM_BACKEND_IMPL_H__ |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 class NET_EXPORT_PRIVATE MemBackendImpl : public Backend { | 25 class NET_EXPORT_PRIVATE MemBackendImpl : public Backend { |
26 public: | 26 public: |
27 explicit MemBackendImpl(net::NetLog* net_log); | 27 explicit MemBackendImpl(net::NetLog* net_log); |
28 virtual ~MemBackendImpl(); | 28 virtual ~MemBackendImpl(); |
29 | 29 |
30 // Returns an instance of a Backend implemented only in memory. The returned | 30 // Returns an instance of a Backend implemented only in memory. The returned |
31 // object should be deleted when not needed anymore. max_bytes is the maximum | 31 // object should be deleted when not needed anymore. max_bytes is the maximum |
32 // size the cache can grow to. If zero is passed in as max_bytes, the cache | 32 // size the cache can grow to. If zero is passed in as max_bytes, the cache |
33 // will determine the value to use based on the available memory. The returned | 33 // will determine the value to use based on the available memory. The returned |
34 // pointer can be NULL if a fatal error is found. | 34 // pointer can be NULL if a fatal error is found. |
35 static Backend* CreateBackend(int max_bytes, net::NetLog* net_log); | 35 static scoped_ptr<Backend> CreateBackend(int max_bytes, net::NetLog* net_log); |
36 | 36 |
37 // Performs general initialization for this current instance of the cache. | 37 // Performs general initialization for this current instance of the cache. |
38 bool Init(); | 38 bool Init(); |
39 | 39 |
40 // Sets the maximum size for the total amount of data stored by this instance. | 40 // Sets the maximum size for the total amount of data stored by this instance. |
41 bool SetMaxSize(int max_bytes); | 41 bool SetMaxSize(int max_bytes); |
42 | 42 |
43 // Permanently deletes an entry. | 43 // Permanently deletes an entry. |
44 void InternalDoomEntry(MemEntryImpl* entry); | 44 void InternalDoomEntry(MemEntryImpl* entry); |
45 | 45 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 int32 current_size_; | 111 int32 current_size_; |
112 | 112 |
113 net::NetLog* net_log_; | 113 net::NetLog* net_log_; |
114 | 114 |
115 DISALLOW_COPY_AND_ASSIGN(MemBackendImpl); | 115 DISALLOW_COPY_AND_ASSIGN(MemBackendImpl); |
116 }; | 116 }; |
117 | 117 |
118 } // namespace disk_cache | 118 } // namespace disk_cache |
119 | 119 |
120 #endif // NET_DISK_CACHE_MEM_BACKEND_IMPL_H__ | 120 #endif // NET_DISK_CACHE_MEM_BACKEND_IMPL_H__ |
OLD | NEW |