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

Unified Diff: net/http/mock_http_cache.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/http/mock_http_cache.h ('k') | net/tools/dump_cache/simple_cache_dumper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/mock_http_cache.cc
diff --git a/net/http/mock_http_cache.cc b/net/http/mock_http_cache.cc
index 3bbf91e9fea94227bdb0904f506be5b741bb0eba..85ffa74584efe289123c9f7d8da4691427d60e12 100644
--- a/net/http/mock_http_cache.cc
+++ b/net/http/mock_http_cache.cc
@@ -480,9 +480,9 @@ void MockDiskCache::CallbackLater(const net::CompletionCallback& callback,
//-----------------------------------------------------------------------------
int MockBackendFactory::CreateBackend(net::NetLog* net_log,
- disk_cache::Backend** backend,
+ scoped_ptr<disk_cache::Backend>* backend,
const net::CompletionCallback& callback) {
- *backend = new MockDiskCache();
+ backend->reset(new MockDiskCache());
return net::OK;
}
@@ -576,9 +576,9 @@ int MockDiskCacheNoCB::CreateEntry(const std::string& key,
//-----------------------------------------------------------------------------
int MockBackendNoCbFactory::CreateBackend(
- net::NetLog* net_log, disk_cache::Backend** backend,
+ net::NetLog* net_log, scoped_ptr<disk_cache::Backend>* backend,
const net::CompletionCallback& callback) {
- *backend = new MockDiskCacheNoCB();
+ backend->reset(new MockDiskCacheNoCB());
return net::OK;
}
@@ -594,11 +594,11 @@ MockBlockingBackendFactory::~MockBlockingBackendFactory() {
}
int MockBlockingBackendFactory::CreateBackend(
- net::NetLog* net_log, disk_cache::Backend** backend,
+ net::NetLog* net_log, scoped_ptr<disk_cache::Backend>* backend,
const net::CompletionCallback& callback) {
if (!block_) {
if (!fail_)
- *backend = new MockDiskCache();
+ backend->reset(new MockDiskCache());
return Result();
}
@@ -611,7 +611,7 @@ void MockBlockingBackendFactory::FinishCreation() {
block_ = false;
if (!callback_.is_null()) {
if (!fail_)
- *backend_ = new MockDiskCache();
+ backend_->reset(new MockDiskCache());
net::CompletionCallback cb = callback_;
callback_.Reset();
cb.Run(Result()); // This object can be deleted here.
« no previous file with comments | « net/http/mock_http_cache.h ('k') | net/tools/dump_cache/simple_cache_dumper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698