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

Unified Diff: net/tools/dump_cache/simple_cache_dumper.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/tools/dump_cache/simple_cache_dumper.h ('k') | net/tools/dump_cache/upgrade_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/dump_cache/simple_cache_dumper.cc
diff --git a/net/tools/dump_cache/simple_cache_dumper.cc b/net/tools/dump_cache/simple_cache_dumper.cc
index dd7c18d9059bec5009821568794727f8c7a4cb62..56162ca3e10905e2e327ea3a807f20519047d947 100644
--- a/net/tools/dump_cache/simple_cache_dumper.cc
+++ b/net/tools/dump_cache/simple_cache_dumper.cc
@@ -24,7 +24,6 @@ SimpleCacheDumper::SimpleCacheDumper(base::FilePath input_path,
: state_(STATE_NONE),
input_path_(input_path),
output_path_(output_path),
- cache_(NULL),
writer_(new DiskDumper(output_path)),
cache_thread_(new base::Thread("CacheThead")),
iter_(NULL),
@@ -36,7 +35,6 @@ SimpleCacheDumper::SimpleCacheDumper(base::FilePath input_path,
}
SimpleCacheDumper::~SimpleCacheDumper() {
- delete(cache_);
}
int SimpleCacheDumper::Run() {
@@ -140,8 +138,8 @@ int SimpleCacheDumper::DoCreateCacheComplete(int rv) {
if (rv < 0)
return rv;
- reinterpret_cast<disk_cache::BackendImpl*>(cache_)->SetUpgradeMode();
- reinterpret_cast<disk_cache::BackendImpl*>(cache_)->SetFlags(
+ reinterpret_cast<disk_cache::BackendImpl*>(cache_.get())->SetUpgradeMode();
+ reinterpret_cast<disk_cache::BackendImpl*>(cache_.get())->SetFlags(
disk_cache::kNoRandom);
state_ = STATE_OPEN_ENTRY;
@@ -267,8 +265,7 @@ void SimpleCacheDumper::OnIOComplete(int rv) {
if (rv != ERR_IO_PENDING) {
rv_ = rv;
- delete cache_;
- cache_ = NULL;
+ cache_.reset();
base::MessageLoop::current()->Quit();
}
}
« no previous file with comments | « net/tools/dump_cache/simple_cache_dumper.h ('k') | net/tools/dump_cache/upgrade_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698