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

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

Issue 462027: Use factory to create histograms, and refcounts to track lifetimes... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years 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/diagnostics/sqlite_diagnostics.cc » ('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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « base/message_loop.cc ('k') | chrome/browser/diagnostics/sqlite_diagnostics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698