diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-06 19:11:51 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-06 19:11:51 +0000 |
commit | 8ebf9b135df2b2a79cf130d39a48185b8f851338 (patch) | |
tree | b1f393ed627e91bf098bffff4fac3b9f3696e59b /net/base/test_completion_callback.h | |
parent | 0b349ba539020caa0201c6523813a16fa41a3448 (diff) | |
download | chromium_src-8ebf9b135df2b2a79cf130d39a48185b8f851338.zip chromium_src-8ebf9b135df2b2a79cf130d39a48185b8f851338.tar.gz chromium_src-8ebf9b135df2b2a79cf130d39a48185b8f851338.tar.bz2 |
base::Bind: Convert disk_cache_based_ssl_host_info.
BUG=none
TEST=none
R=csilv@chromium.org
Review URL: http://codereview.chromium.org/8794003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113249 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/test_completion_callback.h')
-rw-r--r-- | net/base/test_completion_callback.h | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/net/base/test_completion_callback.h b/net/base/test_completion_callback.h index a192194..888c610 100644 --- a/net/base/test_completion_callback.h +++ b/net/base/test_completion_callback.h @@ -22,45 +22,51 @@ // there could be other side-effects resulting from WaitForResult. For this // reason, this class is probably not ideal for a general application. // -class TestOldCompletionCallback : public CallbackRunner< Tuple1<int> > { - public: - TestOldCompletionCallback(); - virtual ~TestOldCompletionCallback(); +// Base class overridden by custom implementations of TestCompletionCallback. +class TestCompletionCallbackBase { + public: + void SetResult(int result); int WaitForResult(); - int GetResult(int result); - bool have_result() const { return have_result_; } - virtual void RunWithParams(const Tuple1<int>& params) OVERRIDE; + protected: + TestCompletionCallbackBase(); - private: int result_; bool have_result_; bool waiting_for_result_; + + private: + DISALLOW_COPY_AND_ASSIGN(TestCompletionCallbackBase); +}; + +class TestOldCompletionCallback : public TestCompletionCallbackBase, + public CallbackRunner< Tuple1<int> > { + public: + TestOldCompletionCallback() {}; + virtual ~TestOldCompletionCallback() {} + + virtual void RunWithParams(const Tuple1<int>& params) OVERRIDE; + + private: + DISALLOW_COPY_AND_ASSIGN(TestOldCompletionCallback); }; namespace net { -class TestCompletionCallback { +class TestCompletionCallback : public TestCompletionCallbackBase { public: TestCompletionCallback(); ~TestCompletionCallback(); - int WaitForResult() { return old_callback_impl_.WaitForResult(); } - - int GetResult(int result) { return old_callback_impl_.GetResult(result); } - - bool have_result() const { return old_callback_impl_.have_result(); } - const CompletionCallback& callback() const { return callback_; } private: - void OnComplete(int result); - const CompletionCallback callback_; - TestOldCompletionCallback old_callback_impl_; + + DISALLOW_COPY_AND_ASSIGN(TestCompletionCallback); }; } // namespace net |