diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/disk_cache/backend_impl.cc | 43 | ||||
-rw-r--r-- | net/disk_cache/backend_impl.h | 18 | ||||
-rw-r--r-- | net/disk_cache/disk_cache_test_util.cc | 3 | ||||
-rw-r--r-- | net/disk_cache/disk_cache_test_util.h | 1 | ||||
-rw-r--r-- | net/disk_cache/eviction.cc | 10 | ||||
-rw-r--r-- | net/disk_cache/eviction.h | 7 | ||||
-rw-r--r-- | net/socket/socket_test_util.cc | 3 | ||||
-rw-r--r-- | net/socket/socket_test_util.h | 1 |
8 files changed, 65 insertions, 21 deletions
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc index 6b415b8..9a3fbe4 100644 --- a/net/disk_cache/backend_impl.cc +++ b/net/disk_cache/backend_impl.cc @@ -339,6 +339,49 @@ int BackendImpl::Init(CompletionCallback* callback) { return net::ERR_IO_PENDING; } +BackendImpl::BackendImpl(const FilePath& path, + base::MessageLoopProxy* cache_thread) + : ALLOW_THIS_IN_INITIALIZER_LIST(background_queue_(this, cache_thread)), + path_(path), + block_files_(path), + mask_(0), + max_size_(0), + cache_type_(net::DISK_CACHE), + uma_report_(0), + user_flags_(0), + init_(false), + restarted_(false), + unit_test_(false), + read_only_(false), + new_eviction_(false), + first_timer_(true), + done_(true, false), + ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)), + ALLOW_THIS_IN_INITIALIZER_LIST(ptr_factory_(this)) { +} + +BackendImpl::BackendImpl(const FilePath& path, + uint32 mask, + base::MessageLoopProxy* cache_thread) + : ALLOW_THIS_IN_INITIALIZER_LIST(background_queue_(this, cache_thread)), + path_(path), + block_files_(path), + mask_(mask), + max_size_(0), + cache_type_(net::DISK_CACHE), + uma_report_(0), + user_flags_(kMask), + init_(false), + restarted_(false), + unit_test_(false), + read_only_(false), + new_eviction_(false), + first_timer_(true), + done_(true, false), + ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)), + ALLOW_THIS_IN_INITIALIZER_LIST(ptr_factory_(this)) { +} + BackendImpl::~BackendImpl() { background_queue_.WaitForPendingIO(); diff --git a/net/disk_cache/backend_impl.h b/net/disk_cache/backend_impl.h index 24af0b4..47bbe96 100644 --- a/net/disk_cache/backend_impl.h +++ b/net/disk_cache/backend_impl.h @@ -37,24 +37,10 @@ enum BackendFlags { class BackendImpl : public Backend { friend class Eviction; public: - BackendImpl(const FilePath& path, base::MessageLoopProxy* cache_thread) - : ALLOW_THIS_IN_INITIALIZER_LIST(background_queue_(this, cache_thread)), - path_(path), block_files_(path), mask_(0), max_size_(0), - cache_type_(net::DISK_CACHE), uma_report_(0), user_flags_(0), - init_(false), restarted_(false), unit_test_(false), read_only_(false), - new_eviction_(false), first_timer_(true), done_(true, false), - ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)), - ALLOW_THIS_IN_INITIALIZER_LIST(ptr_factory_(this)) {} + BackendImpl(const FilePath& path, base::MessageLoopProxy* cache_thread); // 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) - : ALLOW_THIS_IN_INITIALIZER_LIST(background_queue_(this, cache_thread)), - path_(path), block_files_(path), mask_(mask), max_size_(0), - cache_type_(net::DISK_CACHE), uma_report_(0), user_flags_(kMask), - init_(false), restarted_(false), unit_test_(false), read_only_(false), - new_eviction_(false), first_timer_(true), done_(true, false), - ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)), - ALLOW_THIS_IN_INITIALIZER_LIST(ptr_factory_(this)) {} + base::MessageLoopProxy* cache_thread); ~BackendImpl(); // Returns a new backend with the desired flags. See the declaration of diff --git a/net/disk_cache/disk_cache_test_util.cc b/net/disk_cache/disk_cache_test_util.cc index f84b8b2..7dd618a 100644 --- a/net/disk_cache/disk_cache_test_util.cc +++ b/net/disk_cache/disk_cache_test_util.cc @@ -151,6 +151,9 @@ MessageLoopHelper::MessageLoopHelper() TimeDelta::FromMilliseconds(50), this, &MessageLoopHelper::TimerExpired); } +MessageLoopHelper::~MessageLoopHelper() { +} + bool MessageLoopHelper::WaitUntilCacheIoFinished(int num_callbacks) { if (num_callbacks == g_cache_tests_received) return true; diff --git a/net/disk_cache/disk_cache_test_util.h b/net/disk_cache/disk_cache_test_util.h index d639c67..f6348e9 100644 --- a/net/disk_cache/disk_cache_test_util.h +++ b/net/disk_cache/disk_cache_test_util.h @@ -76,6 +76,7 @@ class CallbackTest : public CallbackRunner< Tuple1<int> > { class MessageLoopHelper { public: MessageLoopHelper(); + ~MessageLoopHelper(); // Run the message loop and wait for num_callbacks before returning. Returns // false if we are waiting to long. diff --git a/net/disk_cache/eviction.cc b/net/disk_cache/eviction.cc index 8da01ae..da7577c 100644 --- a/net/disk_cache/eviction.cc +++ b/net/disk_cache/eviction.cc @@ -28,6 +28,7 @@ #include "net/disk_cache/eviction.h" +#include "base/compiler_specific.h" #include "base/logging.h" #include "base/message_loop.h" #include "base/string_util.h" @@ -58,6 +59,15 @@ int LowWaterAdjust(int high_water) { namespace disk_cache { +Eviction::Eviction() + : backend_(NULL), + init_(false), + ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)) { +} + +Eviction::~Eviction() { +} + void Eviction::Init(BackendImpl* backend) { // We grab a bunch of info from the backend to make the code a little cleaner // when we're actually doing work. diff --git a/net/disk_cache/eviction.h b/net/disk_cache/eviction.h index 69736ea..6b13dc0 100644 --- a/net/disk_cache/eviction.h +++ b/net/disk_cache/eviction.h @@ -7,7 +7,6 @@ #pragma once #include "base/basictypes.h" -#include "base/compiler_specific.h" #include "base/task.h" #include "net/disk_cache/disk_format.h" #include "net/disk_cache/rankings.h" @@ -21,10 +20,8 @@ class EntryImpl; // integrated with BackendImpl. class Eviction { public: - Eviction() - : backend_(NULL), init_(false), - ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)) {} - ~Eviction() {} + Eviction(); + ~Eviction(); void Init(BackendImpl* backend); void Stop(); diff --git a/net/socket/socket_test_util.cc b/net/socket/socket_test_util.cc index 46e0e55..bd47f7c 100644 --- a/net/socket/socket_test_util.cc +++ b/net/socket/socket_test_util.cc @@ -641,6 +641,9 @@ DelayedSocketData::DelayedSocketData( set_connect_data(connect); } +DelayedSocketData::~DelayedSocketData() { +} + MockRead DelayedSocketData::GetNextRead() { if (write_delay_ > 0) return MockRead(true, ERR_IO_PENDING); diff --git a/net/socket/socket_test_util.h b/net/socket/socket_test_util.h index f63dd6c..aaa514e 100644 --- a/net/socket/socket_test_util.h +++ b/net/socket/socket_test_util.h @@ -280,6 +280,7 @@ class DelayedSocketData : public StaticSocketDataProvider, DelayedSocketData(const MockConnect& connect, int write_delay, MockRead* reads, size_t reads_count, MockWrite* writes, size_t writes_count); + ~DelayedSocketData(); virtual MockRead GetNextRead(); virtual MockWriteResult OnWrite(const std::string& data); |