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

Unified Diff: net/disk_cache/mem_backend_impl.cc

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, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/disk_cache/mem_backend_impl.h ('k') | net/disk_cache/tracing_cache_backend.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/mem_backend_impl.cc
diff --git a/net/disk_cache/mem_backend_impl.cc b/net/disk_cache/mem_backend_impl.cc
index fe5ea255c5969ad92b6ad933e8a77c3677c697d2..a6f1bf13bedd966a2f6c138254f344a2e24bac8c 100644
--- a/net/disk_cache/mem_backend_impl.cc
+++ b/net/disk_cache/mem_backend_impl.cc
@@ -41,15 +41,15 @@ MemBackendImpl::~MemBackendImpl() {
}
// Static.
-Backend* MemBackendImpl::CreateBackend(int max_bytes, net::NetLog* net_log) {
- MemBackendImpl* cache = new MemBackendImpl(net_log);
+scoped_ptr<Backend> MemBackendImpl::CreateBackend(int max_bytes,
+ net::NetLog* net_log) {
+ scoped_ptr<MemBackendImpl> cache(new MemBackendImpl(net_log));
cache->SetMaxSize(max_bytes);
if (cache->Init())
- return cache;
+ return cache.PassAs<Backend>();
- delete cache;
LOG(ERROR) << "Unable to create cache";
- return NULL;
+ return scoped_ptr<Backend>();
}
bool MemBackendImpl::Init() {
« no previous file with comments | « net/disk_cache/mem_backend_impl.h ('k') | net/disk_cache/tracing_cache_backend.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698