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

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

Issue 515033: Cleanup histogram classes mixing SetFlags into FactoryGet arguments... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 12 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
« no previous file with comments | « base/message_loop.cc ('k') | chrome/browser/chrome_browser_application_mac_unittest.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) 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
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
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
OLDNEW
« no previous file with comments | « base/message_loop.cc ('k') | chrome/browser/chrome_browser_application_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698