diff options
Diffstat (limited to 'ipc/chromium/src/base/message_pump_mac.mm')
-rw-r--r-- | ipc/chromium/src/base/message_pump_mac.mm | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/ipc/chromium/src/base/message_pump_mac.mm b/ipc/chromium/src/base/message_pump_mac.mm index 1382e2a0dc..a5e7092d16 100644 --- a/ipc/chromium/src/base/message_pump_mac.mm +++ b/ipc/chromium/src/base/message_pump_mac.mm @@ -4,14 +4,18 @@ #include "base/message_pump_mac.h" -#import <AppKit/AppKit.h> +#if !defined(XP_IOS) +# import <AppKit/AppKit.h> +# include <IOKit/pwr_mgt/IOPMLib.h> +#endif #import <Foundation/Foundation.h> #include <IOKit/IOMessage.h> -#include <IOKit/pwr_mgt/IOPMLib.h> #include <limits> -#import "base/chrome_application_mac.h" +#if !defined(XP_IOS) +# import "base/chrome_application_mac.h" +#endif #include "base/logging.h" #include "base/time.h" @@ -120,6 +124,7 @@ MessagePumpCFRunLoopBase::MessagePumpCFRunLoopBase() EnterExitObserver, &observer_context); CFRunLoopAddObserver(run_loop_, enter_exit_observer_, kCFRunLoopCommonModes); +#if !defined(XP_IOS) root_power_domain_ = IORegisterForSystemPower(this, &power_notification_port_, PowerStateNotification, &power_notification_object_); @@ -128,12 +133,14 @@ MessagePumpCFRunLoopBase::MessagePumpCFRunLoopBase() run_loop_, IONotificationPortGetRunLoopSource(power_notification_port_), kCFRunLoopCommonModes); } +#endif } // Ideally called on the run loop thread. If other run loops were running // lower on the run loop thread's stack when this object was created, the // same number of run loops must be running when this object is destroyed. MessagePumpCFRunLoopBase::~MessagePumpCFRunLoopBase() { +#if !defined(XP_IOS) if (root_power_domain_ != MACH_PORT_NULL) { CFRunLoopRemoveSource( run_loop_, IONotificationPortGetRunLoopSource(power_notification_port_), @@ -142,6 +149,7 @@ MessagePumpCFRunLoopBase::~MessagePumpCFRunLoopBase() { IOServiceClose(root_power_domain_); IONotificationPortDestroy(power_notification_port_); } +#endif CFRunLoopRemoveObserver(run_loop_, enter_exit_observer_, kCFRunLoopCommonModes); @@ -478,6 +486,7 @@ void MessagePumpCFRunLoopBase::EnterExitObserver(CFRunLoopObserverRef observer, self->EnterExitRunLoop(activity); } +#if !defined(XP_IOS) // Called from the run loop. // static void MessagePumpCFRunLoopBase::PowerStateNotification(void* info, @@ -544,6 +553,7 @@ void MessagePumpCFRunLoopBase::PowerStateNotification(void* info, break; } } +#endif // Called by MessagePumpCFRunLoopBase::EnterExitRunLoop. The default // implementation is a no-op. @@ -630,6 +640,12 @@ void MessagePumpNSRunLoop::Quit() { CFRunLoopWakeUp(run_loop()); } +#if defined(XP_IOS) +void MessagePumpUIApplication::DoRun(Delegate* delegate) { NOTREACHED(); } + +void MessagePumpUIApplication::Quit() { NOTREACHED(); } + +#else MessagePumpNSApplication::MessagePumpNSApplication() : keep_running_(true), running_own_loop_(false) {} @@ -722,11 +738,16 @@ NSAutoreleasePool* MessagePumpNSApplication::CreateAutoreleasePool() { } return pool; } +#endif // static MessagePump* MessagePumpMac::Create() { if ([NSThread isMainThread]) { +#if defined(XP_IOS) + return new MessagePumpUIApplication; +#else return new MessagePumpNSApplication; +#endif } return new MessagePumpNSRunLoop; |