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 bool MessageLoop::InitMessagePumpForUIFactory(MessagePumpFactory* factory) { | 254 void MessageLoop::InitMessagePumpForUIFactory(MessagePumpFactory* factory) { |
255 if (message_pump_for_ui_factory_) | 255 DCHECK(!message_pump_for_ui_factory_); |
256 return false; | |
257 | |
258 message_pump_for_ui_factory_ = factory; | 256 message_pump_for_ui_factory_ = factory; |
259 return true; | |
260 } | 257 } |
261 | 258 |
262 void MessageLoop::AddDestructionObserver( | 259 void MessageLoop::AddDestructionObserver( |
263 DestructionObserver* destruction_observer) { | 260 DestructionObserver* destruction_observer) { |
264 DCHECK_EQ(this, current()); | 261 DCHECK_EQ(this, current()); |
265 destruction_observers_.AddObserver(destruction_observer); | 262 destruction_observers_.AddObserver(destruction_observer); |
266 } | 263 } |
267 | 264 |
268 void MessageLoop::RemoveDestructionObserver( | 265 void MessageLoop::RemoveDestructionObserver( |
269 DestructionObserver* destruction_observer) { | 266 DestructionObserver* destruction_observer) { |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 Watcher *delegate) { | 803 Watcher *delegate) { |
807 return pump_libevent()->WatchFileDescriptor( | 804 return pump_libevent()->WatchFileDescriptor( |
808 fd, | 805 fd, |
809 persistent, | 806 persistent, |
810 mode, | 807 mode, |
811 controller, | 808 controller, |
812 delegate); | 809 delegate); |
813 } | 810 } |
814 | 811 |
815 #endif | 812 #endif |
OLD | NEW |