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

Unified Diff: net/base/test_completion_callback.h

Issue 8832006: Reverts a commit that caused ASAN failures, and 2 dependent commits. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | « chrome_frame/test/infobar_unittests.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 888c61026519dc6f7666bd1d30c7d5be35d7981e..a192194955d83921f49ec974d3a75a4cd34bea28 100644
--- a/net/base/test_completion_callback.h
+++ b/net/base/test_completion_callback.h
@@ -22,51 +22,45 @@
// there could be other side-effects resulting from WaitForResult. For this
// reason, this class is probably not ideal for a general application.
//
-
-// Base class overridden by custom implementations of TestCompletionCallback.
-class TestCompletionCallbackBase {
+class TestOldCompletionCallback : public CallbackRunner< Tuple1<int> > {
public:
- void SetResult(int result);
+ TestOldCompletionCallback();
+ virtual ~TestOldCompletionCallback();
+
int WaitForResult();
+
int GetResult(int result);
+
bool have_result() const { return have_result_; }
- protected:
- TestCompletionCallbackBase();
+ virtual void RunWithParams(const Tuple1<int>& params) OVERRIDE;
+ 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 : public TestCompletionCallbackBase {
+class TestCompletionCallback {
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:
- const CompletionCallback callback_;
+ void OnComplete(int result);
- DISALLOW_COPY_AND_ASSIGN(TestCompletionCallback);
+ const CompletionCallback callback_;
+ TestOldCompletionCallback old_callback_impl_;
};
} // namespace net
« no previous file with comments | « chrome_frame/test/infobar_unittests.cc ('k') | net/base/test_completion_callback.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698