| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 const NSString* name = [exception name]; | 84 const NSString* name = [exception name]; |
| 85 for (int i = 0; kKnownNSExceptionNames[i]; ++i) { | 85 for (int i = 0; kKnownNSExceptionNames[i]; ++i) { |
| 86 if (name == kKnownNSExceptionNames[i]) { | 86 if (name == kKnownNSExceptionNames[i]) { |
| 87 return i; | 87 return i; |
| 88 } | 88 } |
| 89 } | 89 } |
| 90 return kUnknownNSException; | 90 return kUnknownNSException; |
| 91 } | 91 } |
| 92 | 92 |
| 93 void RecordExceptionWithUma(NSException* exception) { | 93 void RecordExceptionWithUma(NSException* exception) { |
| 94 static LinearHistogram histogram("OSX.NSException", 0, kUnknownNSException, | 94 static scoped_refptr<Histogram> histogram = |
| 95 kUnknownNSException + 1); | 95 LinearHistogram::LinearHistogramFactoryGet("OSX.NSException", |
| 96 histogram.SetFlags(kUmaTargetedHistogramFlag); | 96 0, kUnknownNSException, kUnknownNSException + 1); |
| 97 histogram.Add(BinForException(exception)); | 97 histogram->SetFlags(kUmaTargetedHistogramFlag); |
| 98 histogram->Add(BinForException(exception)); |
| 98 } | 99 } |
| 99 | 100 |
| 100 void Terminate() { | 101 void Terminate() { |
| 101 [NSApp terminate:nil]; | 102 [NSApp terminate:nil]; |
| 102 } | 103 } |
| 103 | 104 |
| 104 } // namespace chrome_browser_application_mac | 105 } // namespace chrome_browser_application_mac |
| 105 | 106 |
| 106 namespace { | 107 namespace { |
| 107 | 108 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 SetCrashKeyValue(kLastExceptionKey, value); | 284 SetCrashKeyValue(kLastExceptionKey, value); |
| 284 } | 285 } |
| 285 | 286 |
| 286 reportingException = NO; | 287 reportingException = NO; |
| 287 } | 288 } |
| 288 | 289 |
| 289 [super reportException:anException]; | 290 [super reportException:anException]; |
| 290 } | 291 } |
| 291 | 292 |
| 292 @end | 293 @end |
| OLD | NEW |