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

Unified Diff: content/child/webthread_impl.cc

Issue 959803003: web-threads: Create a single instance of WebThread for each blink thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 10 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 | « content/child/webthread_impl.h ('k') | content/test/test_blink_web_unit_test_support.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webthread_impl.cc
diff --git a/content/child/webthread_impl.cc b/content/child/webthread_impl.cc
index 8a1d7cdda63ad1126ae2161f0ca5b592dd02b01d..572e5890bb53409078ac70da898081855c491450 100644
--- a/content/child/webthread_impl.cc
+++ b/content/child/webthread_impl.cc
@@ -9,7 +9,6 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
-#include "base/message_loop/message_loop.h"
#include "base/pending_task.h"
#include "base/threading/platform_thread.h"
#include "third_party/WebKit/public/platform/WebTraceLocation.h"
@@ -119,12 +118,14 @@ void WebThreadBase::postDelayedTask(const blink::WebTraceLocation& web_location,
void WebThreadBase::enterRunLoop() {
CHECK(isCurrentThread());
+ CHECK(MessageLoop());
CHECK(!MessageLoop()->is_running()); // We don't support nesting.
MessageLoop()->Run();
}
void WebThreadBase::exitRunLoop() {
CHECK(isCurrentThread());
+ CHECK(MessageLoop());
CHECK(MessageLoop()->is_running());
MessageLoop()->Quit();
}
@@ -147,33 +148,11 @@ WebThreadImpl::~WebThreadImpl() {
}
base::MessageLoop* WebThreadImpl::MessageLoop() const {
- return thread_->message_loop();
+ return nullptr;
}
base::SingleThreadTaskRunner* WebThreadImpl::TaskRunner() const {
return thread_->message_loop_proxy().get();
}
-WebThreadImplForMessageLoop::WebThreadImplForMessageLoop(
- scoped_refptr<base::SingleThreadTaskRunner> owning_thread_task_runner)
- : owning_thread_task_runner_(owning_thread_task_runner),
- thread_id_(base::PlatformThread::CurrentId()) {
-}
-
-blink::PlatformThreadId WebThreadImplForMessageLoop::threadId() const {
- return thread_id_;
-}
-
-WebThreadImplForMessageLoop::~WebThreadImplForMessageLoop() {
-}
-
-base::MessageLoop* WebThreadImplForMessageLoop::MessageLoop() const {
- DCHECK(isCurrentThread());
- return base::MessageLoop::current();
-}
-
-base::SingleThreadTaskRunner* WebThreadImplForMessageLoop::TaskRunner() const {
- return owning_thread_task_runner_.get();
-}
-
} // namespace content
« no previous file with comments | « content/child/webthread_impl.h ('k') | content/test/test_blink_web_unit_test_support.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698