OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 // the browser process, so the browser passes the decision to them on the | 175 // the browser process, so the browser passes the decision to them on the |
176 // command line. | 176 // command line. |
177 NSBundle* main_bundle = base::mac::FrameworkBundle(); | 177 NSBundle* main_bundle = base::mac::FrameworkBundle(); |
178 bool is_browser = !base::mac::IsBackgroundOnlyProcess(); | 178 bool is_browser = !base::mac::IsBackgroundOnlyProcess(); |
179 bool enable_breakpad = false; | 179 bool enable_breakpad = false; |
180 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 180 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
181 | 181 |
182 if (is_browser) { | 182 if (is_browser) { |
183 // Since the configuration management infrastructure is possibly not | 183 // Since the configuration management infrastructure is possibly not |
184 // initialized when this code runs, read the policy preference directly. | 184 // initialized when this code runs, read the policy preference directly. |
185 base::mac::ScopedCFTypeRef<CFStringRef> key( | 185 base::ScopedCFTypeRef<CFStringRef> key( |
186 base::SysUTF8ToCFStringRef(policy::key::kMetricsReportingEnabled)); | 186 base::SysUTF8ToCFStringRef(policy::key::kMetricsReportingEnabled)); |
187 Boolean key_valid; | 187 Boolean key_valid; |
188 Boolean metrics_reporting_enabled = CFPreferencesGetAppBooleanValue(key, | 188 Boolean metrics_reporting_enabled = CFPreferencesGetAppBooleanValue(key, |
189 kCFPreferencesCurrentApplication, &key_valid); | 189 kCFPreferencesCurrentApplication, &key_valid); |
190 if (key_valid && | 190 if (key_valid && |
191 CFPreferencesAppValueIsForced(key, kCFPreferencesCurrentApplication)) { | 191 CFPreferencesAppValueIsForced(key, kCFPreferencesCurrentApplication)) { |
192 // Controlled by configuration manangement. | 192 // Controlled by configuration manangement. |
193 enable_breakpad = metrics_reporting_enabled; | 193 enable_breakpad = metrics_reporting_enabled; |
194 } else { | 194 } else { |
195 // Controlled by the user. The crash reporter may be enabled by | 195 // Controlled by the user. The crash reporter may be enabled by |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 | 318 |
319 #if !defined(DISABLE_NACL) | 319 #if !defined(DISABLE_NACL) |
320 if (process_type_switch == switches::kNaClLoaderProcess) { | 320 if (process_type_switch == switches::kNaClLoaderProcess) { |
321 BreakpadSetFilterCallback(gBreakpadRef, NaClBreakpadCrashFilter, NULL); | 321 BreakpadSetFilterCallback(gBreakpadRef, NaClBreakpadCrashFilter, NULL); |
322 } | 322 } |
323 #endif | 323 #endif |
324 | 324 |
325 // Store process type in crash dump. | 325 // Store process type in crash dump. |
326 SetCrashKeyValue(@"ptype", process_type); | 326 SetCrashKeyValue(@"ptype", process_type); |
327 } | 327 } |
OLD | NEW |