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 #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 Loading... |
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 Loading... |
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 |
OLD | NEW |