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

Side by Side Diff: base/message_loop/message_pump_mac.h

Issue 20803005: [Mac] Execute as many MessageLoop tasks as possible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Hacks for Quit() Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/message_loop/message_pump_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // In some cases, CreateAutoreleasePool may return nil intentionally to 110 // In some cases, CreateAutoreleasePool may return nil intentionally to
111 // preventing an autorelease pool from being created, allowing any 111 // preventing an autorelease pool from being created, allowing any
112 // objects autoreleased by work to fall into the current autorelease pool. 112 // objects autoreleased by work to fall into the current autorelease pool.
113 virtual AutoreleasePoolType* CreateAutoreleasePool(); 113 virtual AutoreleasePoolType* CreateAutoreleasePool();
114 114
115 // Enables instrumentation of the MessagePump. See MessagePumpInstrumentation 115 // Enables instrumentation of the MessagePump. See MessagePumpInstrumentation
116 // in the implementation for details. 116 // in the implementation for details.
117 void EnableInstrumentation(); 117 void EnableInstrumentation();
118 WeakPtr<MessagePumpInstrumentation> instrumentation_; 118 WeakPtr<MessagePumpInstrumentation> instrumentation_;
119 119
120 bool quit_was_called_;
121
120 private: 122 private:
121 // Timer callback scheduled by ScheduleDelayedWork. This does not do any 123 // Timer callback scheduled by ScheduleDelayedWork. This does not do any
122 // work, but it signals work_source_ so that delayed work can be performed 124 // work, but it signals work_source_ so that delayed work can be performed
123 // within the appropriate priority constraints. 125 // within the appropriate priority constraints.
124 static void RunDelayedWorkTimer(CFRunLoopTimerRef timer, void* info); 126 static void RunDelayedWorkTimer(CFRunLoopTimerRef timer, void* info);
125 127
126 // Perform highest-priority work. This is associated with work_source_ 128 // Perform highest-priority work. This is associated with work_source_
127 // signalled by ScheduleWork or RunDelayedWorkTimer. The static method calls 129 // signalled by ScheduleWork or RunDelayedWorkTimer. The static method calls
128 // the instance method; the instance method returns true if it resignalled 130 // the instance method; the instance method returns true if it resignalled
129 // work_source_ to be called again from the loop. 131 // work_source_ to be called again from the loop.
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 DISALLOW_IMPLICIT_CONSTRUCTORS(MessagePumpMac); 352 DISALLOW_IMPLICIT_CONSTRUCTORS(MessagePumpMac);
351 }; 353 };
352 354
353 // Tasks posted to the message loop are posted under this mode, as well 355 // Tasks posted to the message loop are posted under this mode, as well
354 // as kCFRunLoopCommonModes. 356 // as kCFRunLoopCommonModes.
355 extern const CFStringRef BASE_EXPORT kMessageLoopExclusiveRunLoopMode; 357 extern const CFStringRef BASE_EXPORT kMessageLoopExclusiveRunLoopMode;
356 358
357 } // namespace base 359 } // namespace base
358 360
359 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_MAC_H_ 361 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_MAC_H_
OLDNEW
« no previous file with comments | « no previous file | base/message_loop/message_pump_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698