| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 const NSString* name = [exception name]; | 105 const NSString* name = [exception name]; |
| 106 for (int i = 0; kKnownNSExceptionNames[i]; ++i) { | 106 for (int i = 0; kKnownNSExceptionNames[i]; ++i) { |
| 107 if (name == kKnownNSExceptionNames[i]) { | 107 if (name == kKnownNSExceptionNames[i]) { |
| 108 return i; | 108 return i; |
| 109 } | 109 } |
| 110 } | 110 } |
| 111 return kUnknownNSException; | 111 return kUnknownNSException; |
| 112 } | 112 } |
| 113 | 113 |
| 114 void RecordExceptionWithUma(NSException* exception) { | 114 void RecordExceptionWithUma(NSException* exception) { |
| 115 static scoped_refptr<Histogram> histogram = | 115 UMA_HISTOGRAM_ENUMERATION("OSX.NSException", |
| 116 LinearHistogram::LinearHistogramFactoryGet("OSX.NSException", | 116 BinForException(exception), kUnknownNSException); |
| 117 0, kUnknownNSException, kUnknownNSException + 1); | |
| 118 histogram->SetFlags(kUmaTargetedHistogramFlag); | |
| 119 histogram->Add(BinForException(exception)); | |
| 120 } | 117 } |
| 121 | 118 |
| 122 void Terminate() { | 119 void Terminate() { |
| 123 [NSApp terminate:nil]; | 120 [NSApp terminate:nil]; |
| 124 } | 121 } |
| 125 | 122 |
| 126 } // namespace chrome_browser_application_mac | 123 } // namespace chrome_browser_application_mac |
| 127 | 124 |
| 128 namespace { | 125 namespace { |
| 129 | 126 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 SetCrashKeyValue(kLastExceptionKey, value); | 302 SetCrashKeyValue(kLastExceptionKey, value); |
| 306 } | 303 } |
| 307 | 304 |
| 308 reportingException = NO; | 305 reportingException = NO; |
| 309 } | 306 } |
| 310 | 307 |
| 311 [super reportException:anException]; | 308 [super reportException:anException]; |
| 312 } | 309 } |
| 313 | 310 |
| 314 @end | 311 @end |
| OLD | NEW |