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

Unified Diff: base/message_loop.h

Issue 11412101: Provide an iOS message pump for IO implementation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Restore StopWatchingFileDescriptor signature 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.h
diff --git a/base/message_loop.h b/base/message_loop.h
index 74dfe659cc92292326a7c2e411ab19076b4ea763..405d98be9ecb083e874585b5de4d3da886a8fb03 100644
--- a/base/message_loop.h
+++ b/base/message_loop.h
@@ -26,6 +26,8 @@
// We need this to declare base::MessagePumpWin::Dispatcher, which we should
// really just eliminate.
#include "base/message_pump_win.h"
+#elif defined(OS_IOS)
+#include "base/message_pump_io_ios.h"
#elif defined(OS_POSIX)
#include "base/message_pump_libevent.h"
#if !defined(OS_MACOSX) && !defined(OS_ANDROID)
@@ -388,7 +390,7 @@ class BASE_EXPORT MessageLoop : public base::MessagePump::Delegate {
base::MessagePumpWin* pump_win() {
return static_cast<base::MessagePumpWin*>(pump_.get());
}
-#elif defined(OS_POSIX)
+#elif defined(OS_POSIX) && !defined(OS_IOS)
base::MessagePumpLibevent* pump_libevent() {
return static_cast<base::MessagePumpLibevent*>(pump_.get());
}
@@ -613,6 +615,17 @@ class BASE_EXPORT MessageLoopForIO : public MessageLoop {
typedef base::MessagePumpForIO::IOHandler IOHandler;
typedef base::MessagePumpForIO::IOContext IOContext;
typedef base::MessagePumpForIO::IOObserver IOObserver;
+#elif defined(OS_IOS)
+ typedef base::MessagePumpIOSForIO::Watcher Watcher;
+ typedef base::MessagePumpIOSForIO::FileDescriptorWatcher
+ FileDescriptorWatcher;
+ typedef base::MessagePumpIOSForIO::IOObserver IOObserver;
+
+ enum Mode {
+ WATCH_READ = base::MessagePumpIOSForIO::WATCH_READ,
+ WATCH_WRITE = base::MessagePumpIOSForIO::WATCH_WRITE,
+ WATCH_READ_WRITE = WATCH_READ | WATCH_WRITE
+ };
#elif defined(OS_POSIX)
typedef base::MessagePumpLibevent::Watcher Watcher;
typedef base::MessagePumpLibevent::FileDescriptorWatcher
@@ -657,6 +670,19 @@ class BASE_EXPORT MessageLoopForIO : public MessageLoop {
return static_cast<base::MessagePumpForIO*>(pump_.get());
}
+#elif defined(OS_IOS)
+ // Please see MessagePumpIOSForIO for definition.
+ bool WatchFileDescriptor(int fd,
+ bool persistent,
+ Mode mode,
+ FileDescriptorWatcher *controller,
+ Watcher *delegate);
+
+ private:
+ base::MessagePumpIOSForIO* pump_io() {
+ return static_cast<base::MessagePumpIOSForIO*>(pump_.get());
+ }
+
#elif defined(OS_POSIX)
// Please see MessagePumpLibevent for definition.
bool WatchFileDescriptor(int fd,

Powered by Google App Engine
This is Rietveld 408576698