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

Unified Diff: webkit/glue/webthread_impl.cc

Issue 9167034: Add support for Run + Quit to WebKit::WebThread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: uses MessageLoop::current and restores MessageLoopProxy, removes OVERRIDE Created 8 years, 11 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 | « webkit/glue/webthread_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webthread_impl.cc
diff --git a/webkit/glue/webthread_impl.cc b/webkit/glue/webthread_impl.cc
index 439137fb380d5a34d2a3496aab6e4eeeab27ac69..5648be05e811167e5d8254577533cc29a30ebf67 100644
--- a/webkit/glue/webthread_impl.cc
+++ b/webkit/glue/webthread_impl.cc
@@ -70,6 +70,18 @@ void WebThreadImpl::postDelayedTask(
base::TimeDelta::FromMilliseconds(delay_ms));
}
+void WebThreadImpl::enterRunLoop() {
+ CHECK(IsCurrentThread());
+ CHECK(!thread_->message_loop()->is_running()); // We don't support nesting.
+ thread_->message_loop()->Run();
+}
+
+void WebThreadImpl::exitRunLoop() {
+ CHECK(IsCurrentThread());
+ CHECK(thread_->message_loop()->is_running());
+ thread_->message_loop()->Quit();
+}
+
bool WebThreadImpl::IsCurrentThread() const {
return thread_->thread_id() == base::PlatformThread::CurrentId();
}
@@ -96,6 +108,18 @@ void WebThreadImplForMessageLoop::postDelayedTask(
delay_ms);
}
+void WebThreadImplForMessageLoop::enterRunLoop() {
+ CHECK(IsCurrentThread());
+ CHECK(!MessageLoop::current()->is_running()); // We don't support nesting.
+ MessageLoop::current()->Run();
+}
+
+void WebThreadImplForMessageLoop::exitRunLoop() {
+ CHECK(IsCurrentThread());
+ CHECK(MessageLoop::current()->is_running());
+ MessageLoop::current()->Quit();
+}
+
bool WebThreadImplForMessageLoop::IsCurrentThread() const {
return message_loop_->BelongsToCurrentThread();
}
« no previous file with comments | « webkit/glue/webthread_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698