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

Side by Side Diff: chrome/browser/chrome_browser_main_mac.mm

Issue 2112553009: mac: Crash on uncaught Objective-C exceptions routed to NSApplication (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Self-review Created 4 years, 5 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
« no previous file with comments | « no previous file | content/app/mac/mac_init.mm » ('j') | 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) 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 #include "chrome/browser/chrome_browser_main_mac.h" 5 #include "chrome/browser/chrome_browser_main_mac.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 145
146 // Now load the nib (from the right bundle). 146 // Now load the nib (from the right bundle).
147 base::scoped_nsobject<NSNib> nib( 147 base::scoped_nsobject<NSNib> nib(
148 [[NSNib alloc] initWithNibNamed:@"MainMenu" 148 [[NSNib alloc] initWithNibNamed:@"MainMenu"
149 bundle:base::mac::FrameworkBundle()]); 149 bundle:base::mac::FrameworkBundle()]);
150 // TODO(viettrungluu): crbug.com/20504 - This currently leaks, so if you 150 // TODO(viettrungluu): crbug.com/20504 - This currently leaks, so if you
151 // change this, you'll probably need to change the Valgrind suppression. 151 // change this, you'll probably need to change the Valgrind suppression.
152 [nib instantiateNibWithOwner:NSApp topLevelObjects:nil]; 152 [nib instantiateNibWithOwner:NSApp topLevelObjects:nil];
153 // Make sure the app controller has been created. 153 // Make sure the app controller has been created.
154 DCHECK([NSApp delegate]); 154 DCHECK([NSApp delegate]);
155
156 [[NSUserDefaults standardUserDefaults] registerDefaults:@{
157 // Prevent Cocoa from turning command-line arguments into
158 // |-application:openFiles:|, since we already handle them directly.
159 // @"NO" looks like a mistake, but the value really is supposed to be a
160 // string.
161 @"NSTreatUnknownArgumentsAsOpen": @"NO"
162 }];
163 } 155 }
164 156
165 void ChromeBrowserMainPartsMac::PostMainMessageLoopStart() { 157 void ChromeBrowserMainPartsMac::PostMainMessageLoopStart() {
166 MacStartupProfiler::GetInstance()->Profile( 158 MacStartupProfiler::GetInstance()->Profile(
167 MacStartupProfiler::POST_MAIN_MESSAGE_LOOP_START); 159 MacStartupProfiler::POST_MAIN_MESSAGE_LOOP_START);
168 ChromeBrowserMainPartsPosix::PostMainMessageLoopStart(); 160 ChromeBrowserMainPartsPosix::PostMainMessageLoopStart();
169 } 161 }
170 162
171 void ChromeBrowserMainPartsMac::PreProfileInit() { 163 void ChromeBrowserMainPartsMac::PreProfileInit() {
172 MacStartupProfiler::GetInstance()->Profile( 164 MacStartupProfiler::GetInstance()->Profile(
(...skipping 29 matching lines...) Expand all
202 [glue updateProfileCountsWithNumProfiles:0 194 [glue updateProfileCountsWithNumProfiles:0
203 numSignedInProfiles:0]; 195 numSignedInProfiles:0];
204 } 196 }
205 } 197 }
206 198
207 void ChromeBrowserMainPartsMac::DidEndMainMessageLoop() { 199 void ChromeBrowserMainPartsMac::DidEndMainMessageLoop() {
208 AppController* appController = 200 AppController* appController =
209 base::mac::ObjCCastStrict<AppController>([NSApp delegate]); 201 base::mac::ObjCCastStrict<AppController>([NSApp delegate]);
210 [appController didEndMainMessageLoop]; 202 [appController didEndMainMessageLoop];
211 } 203 }
OLDNEW
« no previous file with comments | « no previous file | content/app/mac/mac_init.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698