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

Side by Side Diff: base/message_pump_mac.mm

Issue 6334126: Message pump for Mac UI loop starves delayed work (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 10 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 | « base/message_loop_unittest.cc ('k') | no next file » | 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) 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 #include "base/message_pump_mac.h" 5 #include "base/message_pump_mac.h"
6 6
7 #import <AppKit/AppKit.h> 7 #import <AppKit/AppKit.h>
8 #import <Foundation/Foundation.h> 8 #import <Foundation/Foundation.h>
9 #include <IOKit/IOMessage.h> 9 #include <IOKit/IOMessage.h>
10 #include <IOKit/pwr_mgt/IOPMLib.h> 10 #include <IOKit/pwr_mgt/IOPMLib.h>
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 CFRunLoopSourceContext source_context = CFRunLoopSourceContext(); 73 CFRunLoopSourceContext source_context = CFRunLoopSourceContext();
74 source_context.info = this; 74 source_context.info = this;
75 source_context.perform = RunWorkSource; 75 source_context.perform = RunWorkSource;
76 work_source_ = CFRunLoopSourceCreate(NULL, // allocator 76 work_source_ = CFRunLoopSourceCreate(NULL, // allocator
77 1, // priority 77 1, // priority
78 &source_context); 78 &source_context);
79 CFRunLoopAddSource(run_loop_, work_source_, kCFRunLoopCommonModes); 79 CFRunLoopAddSource(run_loop_, work_source_, kCFRunLoopCommonModes);
80 80
81 source_context.perform = RunDelayedWorkSource; 81 source_context.perform = RunDelayedWorkSource;
82 delayed_work_source_ = CFRunLoopSourceCreate(NULL, // allocator 82 delayed_work_source_ = CFRunLoopSourceCreate(NULL, // allocator
83 2, // priority 83 1, // priority
84 &source_context); 84 &source_context);
85 CFRunLoopAddSource(run_loop_, delayed_work_source_, kCFRunLoopCommonModes); 85 CFRunLoopAddSource(run_loop_, delayed_work_source_, kCFRunLoopCommonModes);
86 86
87 source_context.perform = RunIdleWorkSource; 87 source_context.perform = RunIdleWorkSource;
88 idle_work_source_ = CFRunLoopSourceCreate(NULL, // allocator 88 idle_work_source_ = CFRunLoopSourceCreate(NULL, // allocator
89 3, // priority 89 3, // priority
90 &source_context); 90 &source_context);
91 CFRunLoopAddSource(run_loop_, idle_work_source_, kCFRunLoopCommonModes); 91 CFRunLoopAddSource(run_loop_, idle_work_source_, kCFRunLoopCommonModes);
92 92
93 source_context.perform = RunNestingDeferredWorkSource; 93 source_context.perform = RunNestingDeferredWorkSource;
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 // static 758 // static
759 MessagePump* MessagePumpMac::Create() { 759 MessagePump* MessagePumpMac::Create() {
760 if ([NSThread isMainThread]) { 760 if ([NSThread isMainThread]) {
761 return new MessagePumpNSApplication; 761 return new MessagePumpNSApplication;
762 } 762 }
763 763
764 return new MessagePumpNSRunLoop; 764 return new MessagePumpNSRunLoop;
765 } 765 }
766 766
767 } // namespace base 767 } // namespace base
OLDNEW
« no previous file with comments | « base/message_loop_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698