| Index: base/message_loop.cc
|
| diff --git a/base/message_loop.cc b/base/message_loop.cc
|
| index a207659a4a922203a2e3850bbcdde4b1425dd21d..7a6e0921cb09d1b91cb845b24a62a22ea9caf610 100644
|
| --- a/base/message_loop.cc
|
| +++ b/base/message_loop.cc
|
| @@ -313,7 +313,7 @@ void MessageLoop::RunAllPending() {
|
| RunHandler();
|
| }
|
|
|
| -void MessageLoop::Quit() {
|
| +void MessageLoop::QuitWhenIdle() {
|
| DCHECK_EQ(this, current());
|
| if (state_) {
|
| state_->quit_received = true;
|
| @@ -331,13 +331,40 @@ void MessageLoop::QuitNow() {
|
| }
|
| }
|
|
|
| -static void QuitCurrent() {
|
| - MessageLoop::current()->Quit();
|
| +void MessageLoop::QuitAfterPending() {
|
| + DCHECK_EQ(this, current());
|
| + if (state_) {
|
| + PostTask(FROM_HERE, MessageLoop::QuitNowClosure());
|
| + } else {
|
| + NOTREACHED() << "Must be inside Run to call Quit";
|
| + }
|
| +}
|
| +
|
| +static void QuitWhenIdleCurrent() {
|
| + MessageLoop::current()->QuitWhenIdle();
|
| +}
|
| +
|
| +static void QuitNowCurrent() {
|
| + MessageLoop::current()->QuitNow();
|
| +}
|
| +
|
| +static void QuitAfterPendingCurrent() {
|
| + MessageLoop::current()->QuitAfterPending();
|
| +}
|
| +
|
| +// static
|
| +base::Closure MessageLoop::QuitWhenIdleClosure() {
|
| + return base::Bind(&QuitWhenIdleCurrent);
|
| +}
|
| +
|
| +// static
|
| +base::Closure MessageLoop::QuitNowClosure() {
|
| + return base::Bind(&QuitNowCurrent);
|
| }
|
|
|
| // static
|
| -base::Closure MessageLoop::QuitClosure() {
|
| - return base::Bind(&QuitCurrent);
|
| +base::Closure MessageLoop::QuitAfterPendingClosure() {
|
| + return base::Bind(&QuitAfterPendingCurrent);
|
| }
|
|
|
| void MessageLoop::SetNestableTasksAllowed(bool allowed) {
|
|
|