OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <UIKit/UIKit.h> | 5 #import <UIKit/UIKit.h> |
6 | |
7 #include "base/at_exit.h" | |
8 #include "ios/chrome/app/startup/ios_chrome_main.h" | |
6 #import "ios/showcase/core/app_delegate.h" | 9 #import "ios/showcase/core/app_delegate.h" |
7 | 10 |
8 #if !defined(__has_feature) || !__has_feature(objc_arc) | 11 #if !defined(__has_feature) || !__has_feature(objc_arc) |
9 #error "This file requires ARC support." | 12 #error "This file requires ARC support." |
10 #endif | 13 #endif |
11 | 14 |
12 int main(int argc, char* argv[]) { | 15 int main(int argc, char* argv[]) { |
16 // Create the AtExitManager for the application before the crash controller | |
17 // is started. This needs to be stack allocated and live for the lifetime of | |
marq (ping after 24h)
2017/01/24 09:49:07
None of this is needed; we should keep the Showcas
sczs
2017/01/24 18:32:21
Removed everything but the AtExitManager, without
| |
18 // the app. | |
19 base::AtExitManager at_exit; | |
20 | |
21 IOSChromeMain::InitStartTime(); | |
22 | |
23 // Pre-launch actions are in their own autorelease pool so they get cleaned | |
24 // up before the main app starts. | |
25 @autoreleasepool { | |
26 NSUserDefaults* standardDefaults = [NSUserDefaults standardUserDefaults]; | |
27 | |
28 // Set NSUserDefaults keys to force pseudo-RTL if needed. | |
29 if ([standardDefaults boolForKey:@"EnablePseudoRTL"]) { | |
30 NSDictionary* pseudoDict = @{ @"YES" : @"AppleTextDirection" }; | |
31 [standardDefaults registerDefaults:pseudoDict]; | |
32 } | |
33 | |
34 // Always ignore SIGPIPE. Chrome should always check the return value of | |
35 // write() instead of relying on this signal. | |
36 CHECK_NE(SIG_ERR, signal(SIGPIPE, SIG_IGN)); | |
37 } | |
38 | |
13 @autoreleasepool { | 39 @autoreleasepool { |
14 return UIApplicationMain(argc, argv, nil, | 40 return UIApplicationMain(argc, argv, nil, |
15 NSStringFromClass([AppDelegate class])); | 41 NSStringFromClass([AppDelegate class])); |
16 } | 42 } |
17 } | 43 } |
OLD | NEW |