Chromium Code Reviews| 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 56162ca3e10905e2e327ea3a807f20519047d947..1ebdee6be8cd4802fd040d5f0ced6121695a51b6 100644 |
| --- a/net/tools/dump_cache/simple_cache_dumper.cc |
| +++ b/net/tools/dump_cache/simple_cache_dumper.cc |
| @@ -26,7 +26,6 @@ SimpleCacheDumper::SimpleCacheDumper(base::FilePath input_path, |
| output_path_(output_path), |
| writer_(new DiskDumper(output_path)), |
| cache_thread_(new base::Thread("CacheThead")), |
| - iter_(NULL), |
| src_entry_(NULL), |
| dst_entry_(NULL), |
| io_callback_(base::Bind(&SimpleCacheDumper::OnIOComplete, |
| @@ -150,13 +149,15 @@ int SimpleCacheDumper::DoOpenEntry() { |
| DCHECK(!dst_entry_); |
| DCHECK(!src_entry_); |
| state_ = STATE_OPEN_ENTRY_COMPLETE; |
| - return cache_->OpenNextEntry(&iter_, &src_entry_, io_callback_); |
| + if (!iter_) |
| + iter_ = cache_->CreateIterator(); |
| + return iter_->OpenNextEntry(&src_entry_, io_callback_); |
| } |
| int SimpleCacheDumper::DoOpenEntryComplete(int rv) { |
| // ERR_FAILED indicates iteration finished. |
| if (rv == ERR_FAILED) { |
| - cache_->EndEnumeration(&iter_); |
|
gavinp
2014/09/11 23:57:04
From the original version of disk_cache.h: "Whenev
|
| + iter_.reset(); |
| return OK; |
| } |