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

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

Issue 20737002: Change the API of disk_cache::CreateCacheBackend to use scoped_ptr (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix new test Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « net/disk_cache/entry_unittest.cc ('k') | net/disk_cache/mem_backend_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // 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
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
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__
OLDNEW
« no previous file with comments | « net/disk_cache/entry_unittest.cc ('k') | net/disk_cache/mem_backend_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698