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

Unified Diff: net/dns/serial_worker_unittest.cc

Issue 8735014: base::Bind fixes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed compile issues Created 9 years, 1 month 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 | « no previous file | net/dns/watching_file_reader_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/serial_worker_unittest.cc
diff --git a/net/dns/serial_worker_unittest.cc b/net/dns/serial_worker_unittest.cc
index 4062c2a2823a4d8949b0a151e2f1083a558593b5..7fe0ef72e3c9226bbe95ae4cde9e7a04c69ede26 100644
--- a/net/dns/serial_worker_unittest.cc
+++ b/net/dns/serial_worker_unittest.cc
@@ -4,6 +4,7 @@
#include "net/dns/serial_worker.h"
+#include "base/bind.h"
#include "base/message_loop.h"
#include "base/synchronization/lock.h"
#include "base/synchronization/waitable_event.h"
@@ -60,23 +61,15 @@ class SerialWorkerTest : public testing::Test {
}
protected:
- friend class BreakTask;
- class BreakTask : public Task {
- public:
- BreakTask(SerialWorkerTest* test, std::string breakpoint)
- : test_(test), breakpoint_(breakpoint) {}
- virtual ~BreakTask() {}
- virtual void Run() OVERRIDE {
- test_->breakpoint_ = breakpoint_;
- MessageLoop::current()->QuitNow();
- }
- private:
- SerialWorkerTest* test_;
- std::string breakpoint_;
- };
+ void BreakCallback(std::string breakpoint) {
+ breakpoint_ = breakpoint;
+ MessageLoop::current()->QuitNow();
+ }
void BreakNow(std::string b) {
- message_loop_->PostTask(FROM_HERE, new BreakTask(this, b));
+ message_loop_->PostTask(FROM_HERE,
+ base::Bind(&SerialWorkerTest::BreakCallback,
+ base::Unretained(this), b));
}
void RunUntilBreak(std::string b) {
« no previous file with comments | « no previous file | net/dns/watching_file_reader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698