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

Unified Diff: net/tools/dump_cache/upgrade_win.cc

Issue 542733002: Remove void** from disk_cache interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: narrowest, remove unused function Created 6 years, 3 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
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);

Powered by Google App Engine
This is Rietveld 408576698