OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 // Subclasses should implement the work they need to do in MessagePump::Run | 67 // Subclasses should implement the work they need to do in MessagePump::Run |
68 // in the DoRun method. MessagePumpCFRunLoopBase::Run calls DoRun directly. | 68 // in the DoRun method. MessagePumpCFRunLoopBase::Run calls DoRun directly. |
69 // This arrangement is used because MessagePumpCFRunLoopBase needs to set | 69 // This arrangement is used because MessagePumpCFRunLoopBase needs to set |
70 // up and tear down things before and after the "meat" of DoRun. | 70 // up and tear down things before and after the "meat" of DoRun. |
71 virtual void Run(Delegate* delegate) OVERRIDE; | 71 virtual void Run(Delegate* delegate) OVERRIDE; |
72 virtual void DoRun(Delegate* delegate) = 0; | 72 virtual void DoRun(Delegate* delegate) = 0; |
73 | 73 |
74 virtual void ScheduleWork() OVERRIDE; | 74 virtual void ScheduleWork() OVERRIDE; |
75 virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time) OVERRIDE; | 75 virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time) OVERRIDE; |
| 76 virtual void Shutdown() OVERRIDE; |
76 | 77 |
77 protected: | 78 protected: |
78 virtual ~MessagePumpCFRunLoopBase(); | 79 virtual ~MessagePumpCFRunLoopBase(); |
79 | 80 |
80 // Accessors for private data members to be used by subclasses. | 81 // Accessors for private data members to be used by subclasses. |
81 CFRunLoopRef run_loop() const { return run_loop_; } | 82 CFRunLoopRef run_loop() const { return run_loop_; } |
82 int nesting_level() const { return nesting_level_; } | 83 int nesting_level() const { return nesting_level_; } |
83 int run_nesting_level() const { return run_nesting_level_; } | 84 int run_nesting_level() const { return run_nesting_level_; } |
84 | 85 |
85 // Sets this pump's delegate. Signals the appropriate sources if | 86 // Sets this pump's delegate. Signals the appropriate sources if |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 BASE_EXPORT static bool IsHandlingSendEvent(); | 329 BASE_EXPORT static bool IsHandlingSendEvent(); |
329 #endif // !defined(OS_IOS) | 330 #endif // !defined(OS_IOS) |
330 | 331 |
331 private: | 332 private: |
332 DISALLOW_IMPLICIT_CONSTRUCTORS(MessagePumpMac); | 333 DISALLOW_IMPLICIT_CONSTRUCTORS(MessagePumpMac); |
333 }; | 334 }; |
334 | 335 |
335 } // namespace base | 336 } // namespace base |
336 | 337 |
337 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_MAC_H_ | 338 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_MAC_H_ |
OLD | NEW |