summaryrefslogtreecommitdiffstats
path: root/net/disk_cache
diff options
context:
space:
mode:
authorhans@chromium.org <hans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-25 09:08:19 +0000
committerhans@chromium.org <hans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-25 09:08:19 +0000
commit3690ebe09a8c3cea0fd7d9ece8f5b8d8ebc65c19 (patch)
treeb26f7f81e48a95473eb4af5304301e9d8cd22fb8 /net/disk_cache
parenteef99b6591d82399096abdcee07dd67359eec036 (diff)
downloadchromium_src-3690ebe09a8c3cea0fd7d9ece8f5b8d8ebc65c19.zip
chromium_src-3690ebe09a8c3cea0fd7d9ece8f5b8d8ebc65c19.tar.gz
chromium_src-3690ebe09a8c3cea0fd7d9ece8f5b8d8ebc65c19.tar.bz2
Virtual destructors should have virtual keyword.
Make sure user-declared virtual destructors always have the virtual keyword. The Clang style-check plugin will check for this soon. No functionality change: virtual is only added to destructors that are already implicitly virtual. Also fix a couple of in-line destructor definitions. BUG=83408 TEST=none Review URL: http://codereview.chromium.org/7064033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86587 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache')
-rw-r--r--net/disk_cache/backend_impl.h2
-rw-r--r--net/disk_cache/entry_impl.h2
-rw-r--r--net/disk_cache/file_lock.cc4
-rw-r--r--net/disk_cache/file_lock.h5
-rw-r--r--net/disk_cache/in_flight_backend_io.h4
-rw-r--r--net/disk_cache/mem_backend_impl.h2
-rw-r--r--net/disk_cache/mem_entry_impl.h2
-rw-r--r--net/disk_cache/stats_histogram.h2
8 files changed, 13 insertions, 10 deletions
diff --git a/net/disk_cache/backend_impl.h b/net/disk_cache/backend_impl.h
index e66fb4b..cbf6b86 100644
--- a/net/disk_cache/backend_impl.h
+++ b/net/disk_cache/backend_impl.h
@@ -47,7 +47,7 @@ class NET_TEST BackendImpl : public Backend {
// mask can be used to limit the usable size of the hash table, for testing.
BackendImpl(const FilePath& path, uint32 mask,
base::MessageLoopProxy* cache_thread, net::NetLog* net_log);
- ~BackendImpl();
+ virtual ~BackendImpl();
// Returns a new backend with the desired flags. See the declaration of
// CreateCacheBackend().
diff --git a/net/disk_cache/entry_impl.h b/net/disk_cache/entry_impl.h
index 59901a8..830d426 100644
--- a/net/disk_cache/entry_impl.h
+++ b/net/disk_cache/entry_impl.h
@@ -152,7 +152,7 @@ class NET_TEST EntryImpl : public Entry, public base::RefCounted<EntryImpl> {
};
class UserBuffer;
- ~EntryImpl();
+ virtual ~EntryImpl();
// Do all the work for ReadDataImpl and WriteDataImpl. Implemented as
// separate functions to make logging of results simpler.
diff --git a/net/disk_cache/file_lock.cc b/net/disk_cache/file_lock.cc
index 949c645..6e9d949 100644
--- a/net/disk_cache/file_lock.cc
+++ b/net/disk_cache/file_lock.cc
@@ -12,6 +12,10 @@ FileLock::FileLock(BlockFileHeader* header) {
acquired_ = true;
}
+FileLock::~FileLock() {
+ Unlock();
+}
+
void FileLock::Lock() {
if (acquired_)
return;
diff --git a/net/disk_cache/file_lock.h b/net/disk_cache/file_lock.h
index 48f872a..9823292 100644
--- a/net/disk_cache/file_lock.h
+++ b/net/disk_cache/file_lock.h
@@ -31,9 +31,8 @@ namespace disk_cache {
class NET_TEST FileLock {
public:
explicit FileLock(BlockFileHeader* header);
- virtual ~FileLock() {
- Unlock();
- }
+ virtual ~FileLock();
+
// Virtual to make sure the compiler never inlines the calls.
virtual void Lock();
virtual void Unlock();
diff --git a/net/disk_cache/in_flight_backend_io.h b/net/disk_cache/in_flight_backend_io.h
index 89fe3c1..659a33a 100644
--- a/net/disk_cache/in_flight_backend_io.h
+++ b/net/disk_cache/in_flight_backend_io.h
@@ -103,7 +103,7 @@ class BackendIO : public BackgroundIO {
OP_IS_READY
};
- ~BackendIO();
+ virtual ~BackendIO();
void ExecuteBackendOperation();
void ExecuteEntryOperation();
@@ -139,7 +139,7 @@ class InFlightBackendIO : public InFlightIO {
public:
InFlightBackendIO(BackendImpl* backend,
base::MessageLoopProxy* background_thread);
- ~InFlightBackendIO();
+ virtual ~InFlightBackendIO();
// The operations we proxy:
void Init(net::CompletionCallback* callback);
diff --git a/net/disk_cache/mem_backend_impl.h b/net/disk_cache/mem_backend_impl.h
index dae4289..52a78f6 100644
--- a/net/disk_cache/mem_backend_impl.h
+++ b/net/disk_cache/mem_backend_impl.h
@@ -26,7 +26,7 @@ class MemEntryImpl;
class NET_TEST MemBackendImpl : public Backend {
public:
explicit MemBackendImpl(net::NetLog* net_log);
- ~MemBackendImpl();
+ virtual ~MemBackendImpl();
// Returns an instance of a Backend implemented only in memory. The returned
// object should be deleted when not needed anymore. max_bytes is the maximum
diff --git a/net/disk_cache/mem_entry_impl.h b/net/disk_cache/mem_entry_impl.h
index c3872dd..db46c4d 100644
--- a/net/disk_cache/mem_entry_impl.h
+++ b/net/disk_cache/mem_entry_impl.h
@@ -120,7 +120,7 @@ class MemEntryImpl : public Entry {
NUM_STREAMS = 3
};
- ~MemEntryImpl();
+ virtual ~MemEntryImpl();
// Do all the work for corresponding public functions. Implemented as
// separate functions to make logging of results simpler.
diff --git a/net/disk_cache/stats_histogram.h b/net/disk_cache/stats_histogram.h
index 83d359c..7f513ce 100644
--- a/net/disk_cache/stats_histogram.h
+++ b/net/disk_cache/stats_histogram.h
@@ -33,7 +33,7 @@ class StatsHistogram : public base::Histogram {
explicit StatsHistogram(const std::string& name, Sample minimum,
Sample maximum, size_t bucket_count)
: Histogram(name, minimum, maximum, bucket_count), init_(false) {}
- ~StatsHistogram();
+ virtual ~StatsHistogram();
static StatsHistogram* StatsHistogramFactoryGet(const std::string& name);