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

Unified Diff: ios/showcase/core/main.mm

Issue 2651833002: [ios showcase]Configures Resource Bundle and adds Toolbar Coordinator (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: ios/showcase/core/main.mm
diff --git a/ios/showcase/core/main.mm b/ios/showcase/core/main.mm
index ca3097d83ce30c1838e70e8b6893c18f1e8bc587..13b3ea1eeb111c8ec077de616f0580789454b26f 100644
--- a/ios/showcase/core/main.mm
+++ b/ios/showcase/core/main.mm
@@ -3,6 +3,9 @@
// found in the LICENSE file.
#import <UIKit/UIKit.h>
+
+#include "base/at_exit.h"
+#include "ios/chrome/app/startup/ios_chrome_main.h"
#import "ios/showcase/core/app_delegate.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
@@ -10,6 +13,29 @@
#endif
int main(int argc, char* argv[]) {
+ // Create the AtExitManager for the application before the crash controller
+ // 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
+ // the app.
+ base::AtExitManager at_exit;
+
+ IOSChromeMain::InitStartTime();
+
+ // Pre-launch actions are in their own autorelease pool so they get cleaned
+ // up before the main app starts.
+ @autoreleasepool {
+ NSUserDefaults* standardDefaults = [NSUserDefaults standardUserDefaults];
+
+ // Set NSUserDefaults keys to force pseudo-RTL if needed.
+ if ([standardDefaults boolForKey:@"EnablePseudoRTL"]) {
+ NSDictionary* pseudoDict = @{ @"YES" : @"AppleTextDirection" };
+ [standardDefaults registerDefaults:pseudoDict];
+ }
+
+ // Always ignore SIGPIPE. Chrome should always check the return value of
+ // write() instead of relying on this signal.
+ CHECK_NE(SIG_ERR, signal(SIGPIPE, SIG_IGN));
+ }
+
@autoreleasepool {
return UIApplicationMain(argc, argv, nil,
NSStringFromClass([AppDelegate class]));

Powered by Google App Engine
This is Rietveld 408576698