summaryrefslogtreecommitdiffstats
path: root/base/message_loop/message_loop.cc
diff options
context:
space:
mode:
Diffstat (limited to 'base/message_loop/message_loop.cc')
-rw-r--r--base/message_loop/message_loop.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/base/message_loop/message_loop.cc b/base/message_loop/message_loop.cc
index dd1a393..ccece4d 100644
--- a/base/message_loop/message_loop.cc
+++ b/base/message_loop/message_loop.cc
@@ -229,6 +229,14 @@ scoped_ptr<MessagePump> MessageLoop::CreateMessagePumpForType(Type type) {
#define MESSAGE_PUMP_UI scoped_ptr<MessagePump>(new MessagePumpForUI())
#endif
+#if defined(OS_MACOSX)
+ // Use an OS native runloop on Mac to support timer coalescing.
+ #define MESSAGE_PUMP_DEFAULT \
+ scoped_ptr<MessagePump>(new MessagePumpCFRunLoop())
+#else
+ #define MESSAGE_PUMP_DEFAULT scoped_ptr<MessagePump>(new MessagePumpDefault())
+#endif
+
if (type == MessageLoop::TYPE_UI) {
if (message_pump_for_ui_factory_)
return message_pump_for_ui_factory_();
@@ -243,7 +251,7 @@ scoped_ptr<MessagePump> MessageLoop::CreateMessagePumpForType(Type type) {
#endif
DCHECK_EQ(MessageLoop::TYPE_DEFAULT, type);
- return scoped_ptr<MessagePump>(new MessagePumpDefault());
+ return MESSAGE_PUMP_DEFAULT;
}
void MessageLoop::AddDestructionObserver(