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

Unified Diff: base/message_loop/message_loop.cc

Issue 1223193004: Revert of base: Make it possible to replace the MessageLoop's task runner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months 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 | « base/message_loop/message_loop.h ('k') | base/message_loop/message_loop_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop/message_loop.cc
diff --git a/base/message_loop/message_loop.cc b/base/message_loop/message_loop.cc
index 4fecbc5a60383ac5c5a6cd84b92edac99afa6223..0eb24cf7d2f89641950bf36ba7768ca7d2dc7ccc 100644
--- a/base/message_loop/message_loop.cc
+++ b/base/message_loop/message_loop.cc
@@ -170,7 +170,6 @@
// Tell the incoming queue that we are dying.
incoming_task_queue_->WillDestroyCurrentMessageLoop();
incoming_task_queue_ = NULL;
- unbound_task_runner_ = NULL;
task_runner_ = NULL;
// OK, now make it so that no one can find us.
@@ -368,7 +367,6 @@
//------------------------------------------------------------------------------
-// static
scoped_ptr<MessageLoop> MessageLoop::CreateUnbound(
Type type, MessagePumpFactoryCallback pump_factory) {
return make_scoped_ptr(new MessageLoop(type, pump_factory));
@@ -388,9 +386,7 @@
message_histogram_(NULL),
run_loop_(NULL),
incoming_task_queue_(new internal::IncomingTaskQueue(this)),
- unbound_task_runner_(
- new internal::MessageLoopTaskRunner(incoming_task_queue_)),
- task_runner_(unbound_task_runner_) {
+ task_runner_(new internal::MessageLoopTaskRunner(incoming_task_queue_)) {
// If type is TYPE_CUSTOM non-null pump_factory must be given.
DCHECK_EQ(type_ == TYPE_CUSTOM, !pump_factory_.is_null());
}
@@ -406,19 +402,7 @@
lazy_tls_ptr.Pointer()->Set(this);
incoming_task_queue_->StartScheduling();
- unbound_task_runner_->BindToCurrentThread();
- SetTaskRunner(unbound_task_runner_.Pass());
-}
-
-void MessageLoop::SetTaskRunner(
- scoped_refptr<SingleThreadTaskRunner> task_runner) {
- DCHECK_EQ(this, current());
- DCHECK(task_runner->BelongsToCurrentThread());
- DCHECK(!unbound_task_runner_);
- task_runner_ = task_runner.Pass();
- // Clear the previous thread task runner first because only one can exist at
- // a time.
- thread_task_runner_handle_.reset();
+ task_runner_->BindToCurrentThread();
thread_task_runner_handle_.reset(new ThreadTaskRunnerHandle(task_runner_));
}
« no previous file with comments | « base/message_loop/message_loop.h ('k') | base/message_loop/message_loop_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698