Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Unified Diff: base/message_loop/message_loop.cc

Issue 331513002: [Mac] Use a native MessagePump instead of a MessagePumpDefault (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop/message_loop.cc
diff --git a/base/message_loop/message_loop.cc b/base/message_loop/message_loop.cc
index dd1a393ab08633514df9d6d021a1be7ff4dbd23f..a0ad43f5331c305dada3d44cd42480c4a44d907b 100644
--- a/base/message_loop/message_loop.cc
+++ b/base/message_loop/message_loop.cc
@@ -229,6 +229,13 @@ 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>(MessagePumpMac::Create())
Mark Mentovai 2014/06/11 21:59:42 We may want a MessagePumpCFRunLoop instead of a Me
+#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 +250,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(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698