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

Unified Diff: base/message_loop.h

Issue 7276045: Give a CFRunLoop to the IO message loop type on Mac OS X. Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 | « base/base.gypi ('k') | base/message_loop.cc » ('j') | base/message_loop.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop.h
===================================================================
--- base/message_loop.h (revision 90809)
+++ base/message_loop.h (working copy)
@@ -24,9 +24,10 @@
// We need this to declare base::MessagePumpWin::Dispatcher, which we should
// really just eliminate.
#include "base/message_pump_win.h"
+#elif defined(OS_MACOSX)
+#include "base/message_pump_mac.h"
#elif defined(OS_POSIX)
#include "base/message_pump_libevent.h"
-#if !defined(OS_MACOSX)
#if defined(TOUCH_UI)
#include "base/message_pump_x.h"
#else
@@ -34,7 +35,6 @@
#endif
typedef struct _XDisplay Display;
#endif
-#endif
namespace base {
class Histogram;
@@ -431,6 +431,10 @@
base::MessagePumpWin* pump_win() {
return static_cast<base::MessagePumpWin*>(pump_.get());
}
+#elif defined(OS_MACOSX)
+ base::MessagePumpCFRunLoopBase* pump_mac() {
+ return static_cast<base::MessagePumpCFRunLoopBase*>(pump_.get());
+ }
#elif defined(OS_POSIX)
base::MessagePumpLibevent* pump_libevent() {
return static_cast<base::MessagePumpLibevent*>(pump_.get());
@@ -630,6 +634,17 @@
typedef base::MessagePumpForIO::IOHandler IOHandler;
typedef base::MessagePumpForIO::IOContext IOContext;
typedef base::MessagePumpForIO::IOObserver IOObserver;
+#elif defined(OS_MACOSX)
+ typedef base::MessagePumpCFRunLoopBase::Watcher Watcher;
+ typedef base::MessagePumpCFRunLoopBase::FileDescriptorWatcher
+ FileDescriptorWatcher;
+ typedef base::MessagePumpCFRunLoopBase::IOObserver IOObserver;
+
+ enum Mode {
+ WATCH_READ = base::MessagePumpCFRunLoopBase::WATCH_READ,
+ WATCH_WRITE = base::MessagePumpCFRunLoopBase::WATCH_WRITE,
+ WATCH_READ_WRITE = base::MessagePumpCFRunLoopBase::WATCH_READ_WRITE
+ };
#elif defined(OS_POSIX)
typedef base::MessagePumpLibevent::Watcher Watcher;
typedef base::MessagePumpLibevent::FileDescriptorWatcher
@@ -641,7 +656,6 @@
WATCH_WRITE = base::MessagePumpLibevent::WATCH_WRITE,
WATCH_READ_WRITE = base::MessagePumpLibevent::WATCH_READ_WRITE
};
-
#endif
MessageLoopForIO() : MessageLoop(TYPE_IO) {
@@ -673,6 +687,18 @@
return static_cast<base::MessagePumpForIO*>(pump_.get());
}
+#elif defined(OS_MACOSX)
+ // Please see MessagePumpCFRunLoopBase for definition.
+ bool WatchFileDescriptor(int fd,
+ bool persistent,
+ Mode mode,
+ FileDescriptorWatcher *controller,
+ Watcher *delegate);
+
+ private:
+ base::MessagePumpCFRunLoopBase* pump_io() {
+ return static_cast<base::MessagePumpCFRunLoopBase*>(pump_.get());
+ }
#elif defined(OS_POSIX)
// Please see MessagePumpLibevent for definition.
bool WatchFileDescriptor(int fd,
« no previous file with comments | « base/base.gypi ('k') | base/message_loop.cc » ('j') | base/message_loop.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698