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

Unified Diff: components/scheduler/child/webthread_impl_for_worker_scheduler.cc

Issue 1238483003: Revert of Redirect the MessageLoop's task runner to the renderer scheduler (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
Index: components/scheduler/child/webthread_impl_for_worker_scheduler.cc
diff --git a/components/scheduler/child/webthread_impl_for_worker_scheduler.cc b/components/scheduler/child/webthread_impl_for_worker_scheduler.cc
index 0b906a64f1047daa9b2267a8c9f8e357d702aeb0..87ac8208c746bd5b5b01dc10baa27ba93c296749 100644
--- a/components/scheduler/child/webthread_impl_for_worker_scheduler.cc
+++ b/components/scheduler/child/webthread_impl_for_worker_scheduler.cc
@@ -8,6 +8,7 @@
#include "base/location.h"
#include "base/single_thread_task_runner.h"
#include "base/synchronization/waitable_event.h"
+#include "components/scheduler/child/scheduler_message_loop_delegate.h"
#include "components/scheduler/child/web_scheduler_impl.h"
#include "components/scheduler/child/worker_scheduler_impl.h"
#include "third_party/WebKit/public/platform/WebTraceLocation.h"
@@ -18,23 +19,15 @@
const char* name)
: thread_(new base::Thread(name)) {
thread_->Start();
- thread_task_runner_ = thread_->task_runner();
base::WaitableEvent completion(false, false);
- thread_task_runner_->PostTask(
+ thread_->task_runner()->PostTask(
FROM_HERE, base::Bind(&WebThreadImplForWorkerScheduler::InitOnThread,
base::Unretained(this), &completion));
completion.Wait();
}
WebThreadImplForWorkerScheduler::~WebThreadImplForWorkerScheduler() {
- base::WaitableEvent completion(false, false);
- // Shut down the scheduler on the thread to restore the original task runner
- // so that the thread can tear itself down.
- thread_task_runner_->PostTask(
- FROM_HERE, base::Bind(&WebThreadImplForWorkerScheduler::ShutdownOnThread,
- base::Unretained(this), &completion));
- completion.Wait();
thread_->Stop();
}
@@ -49,12 +42,6 @@
worker_scheduler_->DefaultTaskRunner(),
worker_scheduler_->DefaultTaskRunner()));
base::MessageLoop::current()->AddDestructionObserver(this);
- completion->Signal();
-}
-
-void WebThreadImplForWorkerScheduler::ShutdownOnThread(
- base::WaitableEvent* completion) {
- worker_scheduler_->Shutdown();
completion->Signal();
}
« no previous file with comments | « components/scheduler/child/webthread_impl_for_worker_scheduler.h ('k') | components/scheduler/child/worker_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698