| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 run_loop_->quit_when_idle_received_ = true; | 321 run_loop_->quit_when_idle_received_ = true; |
| 322 } else { | 322 } else { |
| 323 NOTREACHED() << "Must be inside Run to call Quit"; | 323 NOTREACHED() << "Must be inside Run to call Quit"; |
| 324 } | 324 } |
| 325 } | 325 } |
| 326 | 326 |
| 327 void MessageLoop::QuitNow() { | 327 void MessageLoop::QuitNow() { |
| 328 DCHECK_EQ(this, current()); | 328 DCHECK_EQ(this, current()); |
| 329 if (run_loop_) { | 329 if (run_loop_) { |
| 330 pump_->Quit(); | 330 pump_->Quit(); |
| 331 #if defined(OS_ANDROID) |
| 332 } else if (type_ == TYPE_UI && |
| 333 static_cast<MessagePumpForUI*>(pump_.get()) |
| 334 ->IsRedundantQuitExpected()) { |
| 335 pump_->Quit(); |
| 336 #endif |
| 331 } else { | 337 } else { |
| 332 NOTREACHED() << "Must be inside Run to call Quit"; | 338 NOTREACHED() << "Must be inside Run to call Quit"; |
| 333 } | 339 } |
| 334 } | 340 } |
| 335 | 341 |
| 336 bool MessageLoop::IsType(Type type) const { | 342 bool MessageLoop::IsType(Type type) const { |
| 337 return type_ == type; | 343 return type_ == type; |
| 338 } | 344 } |
| 339 | 345 |
| 340 static void QuitCurrentWhenIdle() { | 346 static void QuitCurrentWhenIdle() { |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 persistent, | 718 persistent, |
| 713 mode, | 719 mode, |
| 714 controller, | 720 controller, |
| 715 delegate); | 721 delegate); |
| 716 } | 722 } |
| 717 #endif | 723 #endif |
| 718 | 724 |
| 719 #endif // !defined(OS_NACL_SFI) | 725 #endif // !defined(OS_NACL_SFI) |
| 720 | 726 |
| 721 } // namespace base | 727 } // namespace base |
| OLD | NEW |