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

Unified Diff: base/message_loop.cc

Issue 11412101: Provide an iOS message pump for IO implementation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Response to reviews Created 8 years, 1 month 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
Index: base/message_loop.cc
diff --git a/base/message_loop.cc b/base/message_loop.cc
index f4279935227e760f0061025a092ca477ba19b249..542802672927403a6d57f35ed65f11bc5d10d502 100644
--- a/base/message_loop.cc
+++ b/base/message_loop.cc
@@ -27,7 +27,7 @@
#if defined(OS_MACOSX)
#include "base/message_pump_mac.h"
#endif
-#if defined(OS_POSIX)
+#if defined(OS_POSIX) && !defined(OS_IOS)
#include "base/message_pump_libevent.h"
#endif
#if defined(OS_ANDROID)
@@ -157,6 +157,9 @@ MessageLoop::MessageLoop(Type type)
#if defined(OS_WIN)
#define MESSAGE_PUMP_UI new base::MessagePumpForUI()
#define MESSAGE_PUMP_IO new base::MessagePumpForIO()
+#elif defined(OS_IOS)
+#define MESSAGE_PUMP_UI base::MessagePumpMac::Create()
+#define MESSAGE_PUMP_IO new base::MessagePumpIOSForIO()
#elif defined(OS_MACOSX)
#define MESSAGE_PUMP_UI base::MessagePumpMac::Create()
#define MESSAGE_PUMP_IO new base::MessagePumpLibevent()
@@ -776,6 +779,21 @@ bool MessageLoopForIO::WaitForIOCompletion(DWORD timeout, IOHandler* filter) {
return pump_io()->WaitForIOCompletion(timeout, filter);
}
+#elif defined(OS_IOS)
+
+bool MessageLoopForIO::WatchFileDescriptor(int fd,
+ bool persistent,
+ Mode mode,
+ FileDescriptorWatcher *controller,
+ Watcher *delegate) {
+ return pump_io()->WatchFileDescriptor(
+ fd,
+ persistent,
+ mode,
+ controller,
+ delegate);
+}
+
#elif defined(OS_POSIX) && !defined(OS_NACL)
bool MessageLoopForIO::WatchFileDescriptor(int fd,
@@ -786,7 +804,7 @@ bool MessageLoopForIO::WatchFileDescriptor(int fd,
return pump_libevent()->WatchFileDescriptor(
fd,
persistent,
- static_cast<base::MessagePumpLibevent::Mode>(mode),
+ mode,
controller,
delegate);
}

Powered by Google App Engine
This is Rietveld 408576698