| OLD | NEW |
| 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // The basis for all native run loops on the Mac is the CFRunLoop. It can be | 5 // The basis for all native run loops on the Mac is the CFRunLoop. It can be |
| 6 // used directly, it can be used as the driving force behind the similar | 6 // used directly, it can be used as the driving force behind the similar |
| 7 // Foundation NSRunLoop, and it can be used to implement higher-level event | 7 // Foundation NSRunLoop, and it can be used to implement higher-level event |
| 8 // loops such as the NSApplication event loop. | 8 // loops such as the NSApplication event loop. |
| 9 // | 9 // |
| 10 // This file introduces a basic CFRunLoop-based implementation of the | 10 // This file introduces a basic CFRunLoop-based implementation of the |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // or NSRunLoop-based MessagePump subclass depending on which thread it is | 27 // or NSRunLoop-based MessagePump subclass depending on which thread it is |
| 28 // called on. | 28 // called on. |
| 29 | 29 |
| 30 #ifndef BASE_MESSAGE_PUMP_MAC_H_ | 30 #ifndef BASE_MESSAGE_PUMP_MAC_H_ |
| 31 #define BASE_MESSAGE_PUMP_MAC_H_ | 31 #define BASE_MESSAGE_PUMP_MAC_H_ |
| 32 | 32 |
| 33 #include "base/message_pump.h" | 33 #include "base/message_pump.h" |
| 34 | 34 |
| 35 #include <CoreFoundation/CoreFoundation.h> | 35 #include <CoreFoundation/CoreFoundation.h> |
| 36 | 36 |
| 37 #include "base/time.h" | 37 namespace base { |
| 38 | 38 |
| 39 namespace base { | 39 class Time; |
| 40 | 40 |
| 41 class MessagePumpCFRunLoopBase : public MessagePump { | 41 class MessagePumpCFRunLoopBase : public MessagePump { |
| 42 public: | 42 public: |
| 43 MessagePumpCFRunLoopBase(); | 43 MessagePumpCFRunLoopBase(); |
| 44 virtual ~MessagePumpCFRunLoopBase(); | 44 virtual ~MessagePumpCFRunLoopBase(); |
| 45 | 45 |
| 46 // Subclasses should implement the work they need to do in MessagePump::Run | 46 // Subclasses should implement the work they need to do in MessagePump::Run |
| 47 // in the DoRun method. MessagePumpCFRunLoopBase::Run calls DoRun directly. | 47 // in the DoRun method. MessagePumpCFRunLoopBase::Run calls DoRun directly. |
| 48 // This arrangement is used because MessagePumpCFRunLoopBase needs to set | 48 // This arrangement is used because MessagePumpCFRunLoopBase needs to set |
| 49 // up and tear down things before and after the "meat" of DoRun. | 49 // up and tear down things before and after the "meat" of DoRun. |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 // thread. Otherwise, returns a new instance of MessagePumpNSRunLoop. | 172 // thread. Otherwise, returns a new instance of MessagePumpNSRunLoop. |
| 173 static MessagePump* Create(); | 173 static MessagePump* Create(); |
| 174 | 174 |
| 175 private: | 175 private: |
| 176 DISALLOW_IMPLICIT_CONSTRUCTORS(MessagePumpMac); | 176 DISALLOW_IMPLICIT_CONSTRUCTORS(MessagePumpMac); |
| 177 }; | 177 }; |
| 178 | 178 |
| 179 } // namespace base | 179 } // namespace base |
| 180 | 180 |
| 181 #endif // BASE_MESSAGE_PUMP_MAC_H_ | 181 #endif // BASE_MESSAGE_PUMP_MAC_H_ |
| OLD | NEW |