| 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();
|
| }
|
|
|