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 #import "base/message_pump_mac.h" | 5 #import "base/message_pump_mac.h" |
6 | 6 |
7 #import <Foundation/Foundation.h> | 7 #import <Foundation/Foundation.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
13 #include "base/time.h" | 13 #include "base/time.h" |
14 | 14 |
15 #if !defined(OS_IOS) | 15 #if !defined(OS_IOS) |
16 #import <AppKit/AppKit.h> | 16 #import <AppKit/AppKit.h> |
17 #endif // !defined(OS_IOS) | 17 #endif // !defined(OS_IOS) |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 void NoOp(void* info) { | 21 void NoOp(void* info) { |
22 } | 22 } |
23 | 23 |
24 const CFTimeInterval kCFTimeIntervalMax = | 24 const CFTimeInterval kCFTimeIntervalMax = |
25 std::numeric_limits<CFTimeInterval>::max(); | 25 std::numeric_limits<CFTimeInterval>::max(); |
26 | 26 |
27 #if !defined(OS_IOS) | |
27 // Set to true if MessagePumpMac::Create() is called before NSApp is | 28 // Set to true if MessagePumpMac::Create() is called before NSApp is |
28 // initialized. Only accessed from the main thread. | 29 // initialized. Only accessed from the main thread. |
29 bool not_using_crapp = false; | 30 bool not_using_crapp = false; |
wtc
2013/01/04 00:58:36
Nit: this global variable should be named with a g
justincohen
2013/01/04 03:54:10
Done.
| |
31 #endif | |
30 | 32 |
31 } // namespace | 33 } // namespace |
32 | 34 |
33 namespace base { | 35 namespace base { |
34 | 36 |
35 // A scoper for autorelease pools created from message pump run loops. | 37 // A scoper for autorelease pools created from message pump run loops. |
36 // Avoids dirtying up the ScopedNSAutoreleasePool interface for the rare | 38 // Avoids dirtying up the ScopedNSAutoreleasePool interface for the rare |
37 // case where an autorelease pool needs to be passed in. | 39 // case where an autorelease pool needs to be passed in. |
38 class MessagePumpScopedAutoreleasePool { | 40 class MessagePumpScopedAutoreleasePool { |
39 public: | 41 public: |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
690 [NSApplication sharedApplication]; | 692 [NSApplication sharedApplication]; |
691 not_using_crapp = true; | 693 not_using_crapp = true; |
692 return new MessagePumpNSApplication; | 694 return new MessagePumpNSApplication; |
693 #endif | 695 #endif |
694 } | 696 } |
695 | 697 |
696 return new MessagePumpNSRunLoop; | 698 return new MessagePumpNSRunLoop; |
697 } | 699 } |
698 | 700 |
699 } // namespace base | 701 } // namespace base |
OLD | NEW |