OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 // DCHECK(loop) << "Ouch, did you forget to initialize me?"; | 244 // DCHECK(loop) << "Ouch, did you forget to initialize me?"; |
245 return lazy_tls_ptr.Pointer()->Get(); | 245 return lazy_tls_ptr.Pointer()->Get(); |
246 } | 246 } |
247 | 247 |
248 // static | 248 // static |
249 void MessageLoop::EnableHistogrammer(bool enable) { | 249 void MessageLoop::EnableHistogrammer(bool enable) { |
250 enable_histogrammer_ = enable; | 250 enable_histogrammer_ = enable; |
251 } | 251 } |
252 | 252 |
253 // static | 253 // static |
254 void MessageLoop::InitMessagePumpForUIFactory(MessagePumpFactory* factory) { | 254 bool MessageLoop::InitMessagePumpForUIFactory(MessagePumpFactory* factory) { |
255 DCHECK(!message_pump_for_ui_factory_); | 255 if (message_pump_for_ui_factory_) |
| 256 return false; |
| 257 |
256 message_pump_for_ui_factory_ = factory; | 258 message_pump_for_ui_factory_ = factory; |
| 259 return true; |
257 } | 260 } |
258 | 261 |
259 void MessageLoop::AddDestructionObserver( | 262 void MessageLoop::AddDestructionObserver( |
260 DestructionObserver* destruction_observer) { | 263 DestructionObserver* destruction_observer) { |
261 DCHECK_EQ(this, current()); | 264 DCHECK_EQ(this, current()); |
262 destruction_observers_.AddObserver(destruction_observer); | 265 destruction_observers_.AddObserver(destruction_observer); |
263 } | 266 } |
264 | 267 |
265 void MessageLoop::RemoveDestructionObserver( | 268 void MessageLoop::RemoveDestructionObserver( |
266 DestructionObserver* destruction_observer) { | 269 DestructionObserver* destruction_observer) { |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 Watcher *delegate) { | 806 Watcher *delegate) { |
804 return pump_libevent()->WatchFileDescriptor( | 807 return pump_libevent()->WatchFileDescriptor( |
805 fd, | 808 fd, |
806 persistent, | 809 persistent, |
807 mode, | 810 mode, |
808 controller, | 811 controller, |
809 delegate); | 812 delegate); |
810 } | 813 } |
811 | 814 |
812 #endif | 815 #endif |
OLD | NEW |