OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 BreakpadRemoveUploadParameter(gBreakpadRef, key); | 50 BreakpadRemoveUploadParameter(gBreakpadRef, key); |
51 } | 51 } |
52 | 52 |
53 } // namespace | 53 } // namespace |
54 | 54 |
55 bool IsCrashReporterEnabled() { | 55 bool IsCrashReporterEnabled() { |
56 return gBreakpadRef != NULL; | 56 return gBreakpadRef != NULL; |
57 } | 57 } |
58 | 58 |
59 void DestructCrashReporter() { | |
60 if (gBreakpadRef) { | |
61 BreakpadRelease(gBreakpadRef); | |
62 gBreakpadRef = NULL; | |
63 } | |
64 } | |
65 | |
66 // Only called for a branded build of Chrome.app. | 59 // Only called for a branded build of Chrome.app. |
67 void InitCrashReporter() { | 60 void InitCrashReporter() { |
68 DCHECK(!gBreakpadRef); | 61 DCHECK(!gBreakpadRef); |
69 base::mac::ScopedNSAutoreleasePool autorelease_pool; | 62 base::mac::ScopedNSAutoreleasePool autorelease_pool; |
70 | 63 |
71 // Check whether crash reporting should be enabled. If enterprise | 64 // Check whether crash reporting should be enabled. If enterprise |
72 // configuration management controls crash reporting, it takes precedence. | 65 // configuration management controls crash reporting, it takes precedence. |
73 // Otherwise, check whether the user has consented to stats and crash | 66 // Otherwise, check whether the user has consented to stats and crash |
74 // reporting. The browser process can make this determination directly. | 67 // reporting. The browser process can make this determination directly. |
75 // Helper processes may not have access to the disk or to the same data as | 68 // Helper processes may not have access to the disk or to the same data as |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 std::string process_type_switch = | 189 std::string process_type_switch = |
197 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 190 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
198 switches::kProcessType); | 191 switches::kProcessType); |
199 if (!process_type_switch.empty()) { | 192 if (!process_type_switch.empty()) { |
200 process_type = base::SysUTF8ToNSString(process_type_switch); | 193 process_type = base::SysUTF8ToNSString(process_type_switch); |
201 } | 194 } |
202 | 195 |
203 // Store process type in crash dump. | 196 // Store process type in crash dump. |
204 SetCrashKeyValue(@"ptype", process_type); | 197 SetCrashKeyValue(@"ptype", process_type); |
205 } | 198 } |
OLD | NEW |