| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.h" | 5 #include "base/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 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 826 | 826 |
| 827 #if !defined(OS_MACOSX) && !defined(OS_NACL) && !defined(OS_ANDROID) | 827 #if !defined(OS_MACOSX) && !defined(OS_NACL) && !defined(OS_ANDROID) |
| 828 void MessageLoopForUI::AddObserver(Observer* observer) { | 828 void MessageLoopForUI::AddObserver(Observer* observer) { |
| 829 pump_ui()->AddObserver(observer); | 829 pump_ui()->AddObserver(observer); |
| 830 } | 830 } |
| 831 | 831 |
| 832 void MessageLoopForUI::RemoveObserver(Observer* observer) { | 832 void MessageLoopForUI::RemoveObserver(Observer* observer) { |
| 833 pump_ui()->RemoveObserver(observer); | 833 pump_ui()->RemoveObserver(observer); |
| 834 } | 834 } |
| 835 | 835 |
| 836 void MessageLoopForUI::Run(Dispatcher* dispatcher) { | 836 void MessageLoopForUI::RunWithDispatcher(Dispatcher* dispatcher) { |
| 837 AutoRunState save_state(this); | 837 AutoRunState save_state(this); |
| 838 state_->dispatcher = dispatcher; | 838 state_->dispatcher = dispatcher; |
| 839 RunHandler(); | 839 RunHandler(); |
| 840 } | 840 } |
| 841 | 841 |
| 842 void MessageLoopForUI::RunAllPendingWithDispatcher(Dispatcher* dispatcher) { | 842 void MessageLoopForUI::RunAllPendingWithDispatcher(Dispatcher* dispatcher) { |
| 843 AutoRunState save_state(this); | 843 AutoRunState save_state(this); |
| 844 state_->dispatcher = dispatcher; | 844 state_->dispatcher = dispatcher; |
| 845 state_->quit_received = true; // Means run until we would otherwise block. | 845 state_->quit_received = true; // Means run until we would otherwise block. |
| 846 RunHandler(); | 846 RunHandler(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 870 Watcher *delegate) { | 870 Watcher *delegate) { |
| 871 return pump_libevent()->WatchFileDescriptor( | 871 return pump_libevent()->WatchFileDescriptor( |
| 872 fd, | 872 fd, |
| 873 persistent, | 873 persistent, |
| 874 static_cast<base::MessagePumpLibevent::Mode>(mode), | 874 static_cast<base::MessagePumpLibevent::Mode>(mode), |
| 875 controller, | 875 controller, |
| 876 delegate); | 876 delegate); |
| 877 } | 877 } |
| 878 | 878 |
| 879 #endif | 879 #endif |
| OLD | NEW |