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

Unified Diff: net/base/test_completion_callback.h

Issue 8898036: base::Bind: Convert proxy_resolving_client_socket.[cc,h] and deps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Possible test fix. Created 9 years 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
« no previous file with comments | « jingle/notifier/base/proxy_resolving_client_socket.cc ('k') | net/base/test_completion_callback.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/test_completion_callback.h
diff --git a/net/base/test_completion_callback.h b/net/base/test_completion_callback.h
index a192194955d83921f49ec974d3a75a4cd34bea28..5dff389c692f63f9d335c2f4d7d4985669db1659 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
« no previous file with comments | « jingle/notifier/base/proxy_resolving_client_socket.cc ('k') | net/base/test_completion_callback.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698