summaryrefslogtreecommitdiffstats
path: root/net/base/test_completion_callback.cc
diff options
context:
space:
mode:
authorjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-07 14:15:36 +0000
committerjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-07 14:15:36 +0000
commit2c5c9d596ad422529c88b47db2b60eff9410cde0 (patch)
tree0625f8f8cb92d6c5ec93efb6892beb13bc6a43bb /net/base/test_completion_callback.cc
parent4ba14e1044e2e837a8c81894df156e4fd4be86bd (diff)
downloadchromium_src-2c5c9d596ad422529c88b47db2b60eff9410cde0.zip
chromium_src-2c5c9d596ad422529c88b47db2b60eff9410cde0.tar.gz
chromium_src-2c5c9d596ad422529c88b47db2b60eff9410cde0.tar.bz2
Reverts a commit that caused ASAN failures, and 2 dependent commits.
The primary commit was 113249, the dependents were 113261, 113263. This is a speculative revert, r113249 is by far the likeliest culprit in the blamelist of build http://build.chromium.org/p/chromium.memory/builders/ASAN%20Tests%20%282%29/builds/2325 which is where we started seeing the ASAN failures in question, will un-revert if it does not fix the problem. TBR=jhawkins@chromium.org BUG=none Review URL: http://codereview.chromium.org/8832006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113387 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/test_completion_callback.cc')
-rw-r--r--net/base/test_completion_callback.cc37
1 files changed, 17 insertions, 20 deletions
diff --git a/net/base/test_completion_callback.cc b/net/base/test_completion_callback.cc
index 9d1de1a..6851a7c 100644
--- a/net/base/test_completion_callback.cc
+++ b/net/base/test_completion_callback.cc
@@ -9,53 +9,50 @@
#include "base/message_loop.h"
#include "net/base/net_errors.h"
-void TestCompletionCallbackBase::SetResult(int result) {
- result_ = result;
- have_result_ = true;
- if (waiting_for_result_)
- MessageLoop::current()->Quit();
+TestOldCompletionCallback::TestOldCompletionCallback()
+ : result_(0),
+ have_result_(false),
+ waiting_for_result_(false) {
}
-int TestCompletionCallbackBase::WaitForResult() {
- DCHECK(!waiting_for_result_);
+TestOldCompletionCallback::~TestOldCompletionCallback() {}
+int TestOldCompletionCallback::WaitForResult() {
+ DCHECK(!waiting_for_result_);
while (!have_result_) {
- printf("waiting\n");
waiting_for_result_ = true;
MessageLoop::current()->Run();
waiting_for_result_ = false;
}
-
- have_result_ = false; // Auto-reset for next callback.
+ have_result_ = false; // auto-reset for next callback
return result_;
}
-int TestCompletionCallbackBase::GetResult(int result) {
+int TestOldCompletionCallback::GetResult(int result) {
if (net::ERR_IO_PENDING != result)
return result;
-
return WaitForResult();
}
-TestCompletionCallbackBase::TestCompletionCallbackBase()
- : result_(0),
- have_result_(false),
- waiting_for_result_(false) {
-}
-
void TestOldCompletionCallback::RunWithParams(const Tuple1<int>& params) {
- SetResult(params.a);
+ result_ = params.a;
+ have_result_ = true;
+ if (waiting_for_result_)
+ MessageLoop::current()->Quit();
}
namespace net {
TestCompletionCallback::TestCompletionCallback()
: ALLOW_THIS_IN_INITIALIZER_LIST(callback_(
- base::Bind(&TestCompletionCallback::SetResult,
+ base::Bind(&TestCompletionCallback::OnComplete,
base::Unretained(this)))) {
}
TestCompletionCallback::~TestCompletionCallback() {}
+void TestCompletionCallback::OnComplete(int result) {
+ old_callback_impl_.RunWithParams(Tuple1<int>(result));
+}
} // namespace net