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

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

Issue 2835007: Revert 49984 - patch from issue 2762014 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/chrome_browser_application_mac.h" 5 #import "chrome/browser/chrome_browser_application_mac.h"
6 6
7 #import "base/histogram.h" 7 #import "base/histogram.h"
8 #import "base/logging.h" 8 #import "base/logging.h"
9 #import "base/scoped_nsobject.h" 9 #import "base/scoped_nsobject.h"
10 #import "base/sys_string_conversions.h" 10 #import "base/sys_string_conversions.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 // interesting to track in aggregate (those relating to distributed 78 // interesting to track in aggregate (those relating to distributed
79 // objects, for instance). 79 // objects, for instance).
80 const size_t kKnownNSExceptionCount = 25; 80 const size_t kKnownNSExceptionCount = 25;
81 81
82 const size_t kUnknownNSException = kKnownNSExceptionCount; 82 const size_t kUnknownNSException = kKnownNSExceptionCount;
83 83
84 size_t BinForException(NSException* exception) { 84 size_t BinForException(NSException* exception) {
85 // A list of common known exceptions. The list position will 85 // A list of common known exceptions. The list position will
86 // determine where they live in the histogram, so never move them 86 // determine where they live in the histogram, so never move them
87 // around, only add to the end. 87 // around, only add to the end.
88 <<<<<<< HEAD
89 static NSString* const kKnownNSExceptionNames[] = { 88 static NSString* const kKnownNSExceptionNames[] = {
90 =======
91 static NSString* kKnownNSExceptionNames[] = {
92 >>>>>>> more
93 // ??? 89 // ???
94 NSGenericException, 90 NSGenericException,
95 91
96 // Out-of-range on NSString or NSArray. 92 // Out-of-range on NSString or NSArray.
97 NSRangeException, 93 NSRangeException,
98 94
99 // Invalid arg to method, unrecognized selector. 95 // Invalid arg to method, unrecognized selector.
100 NSInvalidArgumentException, 96 NSInvalidArgumentException,
101 97
102 // malloc() returned null in object creation, I think. 98 // malloc() returned null in object creation, I think.
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 } 269 }
274 } 270 }
275 if (!found) { 271 if (!found) {
276 return NO; 272 return NO;
277 } 273 }
278 } 274 }
279 275
280 // When a Cocoa control is wired to a freed object, we get crashers 276 // When a Cocoa control is wired to a freed object, we get crashers
281 // in the call to |super| with no useful information in the 277 // in the call to |super| with no useful information in the
282 // backtrace. Attempt to add some useful information. 278 // backtrace. Attempt to add some useful information.
283 <<<<<<< HEAD
284 static NSString* const kActionKey = @"sendaction"; 279 static NSString* const kActionKey = @"sendaction";
285 =======
286 static NSString* kActionKey = @"sendaction";
287 >>>>>>> more
288 280
289 // If the action is something generic like -commandDispatch:, then 281 // If the action is something generic like -commandDispatch:, then
290 // the tag is essential. 282 // the tag is essential.
291 NSInteger tag = 0; 283 NSInteger tag = 0;
292 if ([sender isKindOfClass:[NSControl class]]) { 284 if ([sender isKindOfClass:[NSControl class]]) {
293 tag = [sender tag]; 285 tag = [sender tag];
294 if (tag == 0 || tag == -1) { 286 if (tag == 0 || tag == -1) {
295 tag = [sender selectedTag]; 287 tag = [sender selectedTag];
296 } 288 }
297 } else if ([sender isKindOfClass:[NSMenuItem class]]) { 289 } else if ([sender isKindOfClass:[NSMenuItem class]]) {
(...skipping 21 matching lines...) Expand all
319 if (!reportingException) { 311 if (!reportingException) {
320 reportingException = YES; 312 reportingException = YES;
321 chrome_browser_application_mac::RecordExceptionWithUma(anException); 313 chrome_browser_application_mac::RecordExceptionWithUma(anException);
322 314
323 // Store some human-readable information in breakpad keys in case 315 // Store some human-readable information in breakpad keys in case
324 // there is a crash. Since breakpad does not provide infinite 316 // there is a crash. Since breakpad does not provide infinite
325 // storage, we track two exceptions. The first exception thrown 317 // storage, we track two exceptions. The first exception thrown
326 // is tracked because it may be the one which caused the system to 318 // is tracked because it may be the one which caused the system to
327 // go off the rails. The last exception thrown is tracked because 319 // go off the rails. The last exception thrown is tracked because
328 // it may be the one most directly associated with the crash. 320 // it may be the one most directly associated with the crash.
329 <<<<<<< HEAD
330 static NSString* const kFirstExceptionKey = @"firstexception"; 321 static NSString* const kFirstExceptionKey = @"firstexception";
331 static BOOL trackedFirstException = NO; 322 static BOOL trackedFirstException = NO;
332 static NSString* const kLastExceptionKey = @"lastexception"; 323 static NSString* const kLastExceptionKey = @"lastexception";
333 =======
334 static NSString* kFirstExceptionKey = @"firstexception";
335 static BOOL trackedFirstException = NO;
336 static NSString* kLastExceptionKey = @"lastexception";
337 >>>>>>> more
338 324
339 // TODO(shess): It would be useful to post some stacktrace info 325 // TODO(shess): It would be useful to post some stacktrace info
340 // from the exception. 326 // from the exception.
341 // 10.6 has -[NSException callStackSymbols] 327 // 10.6 has -[NSException callStackSymbols]
342 // 10.5 has -[NSException callStackReturnAddresses] 328 // 10.5 has -[NSException callStackReturnAddresses]
343 // 10.5 has backtrace_symbols(). 329 // 10.5 has backtrace_symbols().
344 // I've tried to combine the latter two, but got nothing useful. 330 // I've tried to combine the latter two, but got nothing useful.
345 // The addresses are right, though, maybe we could train the crash 331 // The addresses are right, though, maybe we could train the crash
346 // server to decode them for us. 332 // server to decode them for us.
347 333
348 NSString* value = [NSString stringWithFormat:@"%@ reason %@", 334 NSString* value = [NSString stringWithFormat:@"%@ reason %@",
349 [anException name], [anException reason]]; 335 [anException name], [anException reason]];
350 if (!trackedFirstException) { 336 if (!trackedFirstException) {
351 SetCrashKeyValue(kFirstExceptionKey, value); 337 SetCrashKeyValue(kFirstExceptionKey, value);
352 trackedFirstException = YES; 338 trackedFirstException = YES;
353 } else { 339 } else {
354 SetCrashKeyValue(kLastExceptionKey, value); 340 SetCrashKeyValue(kLastExceptionKey, value);
355 } 341 }
356 342
357 reportingException = NO; 343 reportingException = NO;
358 } 344 }
359 345
360 [super reportException:anException]; 346 [super reportException:anException];
361 } 347 }
362 348
363 @end 349 @end
OLDNEW
« no previous file with comments | « chrome/browser/autofill/autofill_text_field_mac.mm ('k') | chrome/browser/cocoa/authorization_util.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698