OLD | NEW |
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/app/breakpad_mac.h" | 5 #import "chrome/app/breakpad_mac.h" |
6 | 6 |
7 #include <CoreFoundation/CoreFoundation.h> | 7 #include <CoreFoundation/CoreFoundation.h> |
8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 | 9 |
10 #include "base/base_switches.h" | 10 #include "base/base_switches.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 void DestructCrashReporter() { | 39 void DestructCrashReporter() { |
40 if (gBreakpadRef) { | 40 if (gBreakpadRef) { |
41 BreakpadRelease(gBreakpadRef); | 41 BreakpadRelease(gBreakpadRef); |
42 gBreakpadRef = NULL; | 42 gBreakpadRef = NULL; |
43 } | 43 } |
44 } | 44 } |
45 | 45 |
46 // Only called for a branded build of Chrome.app. | 46 // Only called for a branded build of Chrome.app. |
47 void InitCrashReporter() { | 47 void InitCrashReporter() { |
48 DCHECK(gBreakpadRef == NULL); | 48 DCHECK(!gBreakpadRef); |
49 base::mac::ScopedNSAutoreleasePool autorelease_pool; | 49 base::mac::ScopedNSAutoreleasePool autorelease_pool; |
50 | 50 |
51 // Check whether crash reporting should be enabled. If enterprise | 51 // Check whether crash reporting should be enabled. If enterprise |
52 // configuration management controls crash reporting, it takes precedence. | 52 // configuration management controls crash reporting, it takes precedence. |
53 // Otherwise, check whether the user has consented to stats and crash | 53 // Otherwise, check whether the user has consented to stats and crash |
54 // reporting. The browser process can make this determination directly. | 54 // reporting. The browser process can make this determination directly. |
55 // Helper processes may not have access to the disk or to the same data as | 55 // Helper processes may not have access to the disk or to the same data as |
56 // the browser process, so the browser passes the decision to them on the | 56 // the browser process, so the browser passes the decision to them on the |
57 // command line. | 57 // command line. |
58 NSBundle* main_bundle = base::mac::MainAppBundle(); | 58 NSBundle* main_bundle = base::mac::MainAppBundle(); |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 BreakpadAddUploadParameter(gBreakpadRef, key, value); | 196 BreakpadAddUploadParameter(gBreakpadRef, key, value); |
197 } | 197 } |
198 | 198 |
199 void ClearCrashKeyValue(NSString* key) { | 199 void ClearCrashKeyValue(NSString* key) { |
200 if (gBreakpadRef == NULL) { | 200 if (gBreakpadRef == NULL) { |
201 return; | 201 return; |
202 } | 202 } |
203 | 203 |
204 BreakpadRemoveUploadParameter(gBreakpadRef, key); | 204 BreakpadRemoveUploadParameter(gBreakpadRef, key); |
205 } | 205 } |
OLD | NEW |