| Index: net/tools/dump_cache/upgrade_win.cc
|
| diff --git a/net/tools/dump_cache/upgrade_win.cc b/net/tools/dump_cache/upgrade_win.cc
|
| index dfb9e5c32fc5651094e35aba56f07a7b77b06644..5b959e620d399ae317d87b03cfc732cb37f5a75b 100644
|
| --- a/net/tools/dump_cache/upgrade_win.cc
|
| +++ b/net/tools/dump_cache/upgrade_win.cc
|
| @@ -6,6 +6,7 @@
|
|
|
| #include "base/bind.h"
|
| #include "base/bind_helpers.h"
|
| +#include "base/compiler_specific.h"
|
| #include "base/logging.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/message_loop/message_loop.h"
|
| @@ -556,10 +557,9 @@ void MasterSM::Fail() {
|
|
|
| // -----------------------------------------------------------------------
|
|
|
| -class SlaveSM : public BaseSM {
|
| +class SlaveSM FINAL : public BaseSM {
|
| public:
|
| SlaveSM(const base::FilePath& path, HANDLE channel);
|
| - virtual ~SlaveSM();
|
|
|
| bool DoInit();
|
| virtual void OnIOCompleted(base::MessageLoopForIO::IOContext* context,
|
| @@ -586,14 +586,13 @@ class SlaveSM : public BaseSM {
|
| void DoEnd();
|
| void Fail();
|
|
|
| - void* iterator_;
|
| + disk_cache::Backend::Iterator iterator_;
|
| Message msg_; // Used for DoReadDataComplete and DoGetEntryComplete.
|
|
|
| scoped_ptr<disk_cache::BackendImpl> cache_;
|
| };
|
|
|
| -SlaveSM::SlaveSM(const base::FilePath& path, HANDLE channel)
|
| - : BaseSM(channel), iterator_(NULL) {
|
| +SlaveSM::SlaveSM(const base::FilePath& path, HANDLE channel) : BaseSM(channel) {
|
| scoped_ptr<disk_cache::Backend> cache;
|
| net::TestCompletionCallback cb;
|
| int rv = disk_cache::CreateCacheBackend(net::DISK_CACHE,
|
| @@ -609,11 +608,6 @@ SlaveSM::SlaveSM(const base::FilePath& path, HANDLE channel)
|
| cache_->SetUpgradeMode();
|
| }
|
|
|
| -SlaveSM::~SlaveSM() {
|
| - if (iterator_)
|
| - cache_->EndEnumeration(&iterator_);
|
| -}
|
| -
|
| void SlaveSM::OnIOCompleted(base::MessageLoopForIO::IOContext* context,
|
| DWORD bytes_transfered,
|
| DWORD error) {
|
| @@ -761,7 +755,7 @@ void SlaveSM::DoCloseEntry() {
|
| } else {
|
| entry_->Close();
|
| entry_ = NULL;
|
| - cache_->EndEnumeration(&iterator_);
|
| + iterator_.reset();
|
| msg.result = RESULT_OK;
|
| }
|
| SendMsg(msg);
|
|
|