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

Side by Side Diff: chrome/app/chrome_crash_reporter_client_mac.mm

Issue 2610883006: Enable UMA reporting for crashpad_handler on macOS (Closed)
Patch Set: Created 3 years, 11 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "chrome/app/chrome_crash_reporter_client.h" 5 #include "chrome/app/chrome_crash_reporter_client.h"
6 6
7 #include <CoreFoundation/CoreFoundation.h> 7 #include <CoreFoundation/CoreFoundation.h>
8 8
9 #include "base/mac/scoped_cftyperef.h" 9 #include "base/mac/scoped_cftyperef.h"
10 #include "base/path_service.h"
10 #include "base/strings/sys_string_conversions.h" 11 #include "base/strings/sys_string_conversions.h"
12 #include "chrome/common/chrome_paths.h"
11 #include "components/policy/policy_constants.h" 13 #include "components/policy/policy_constants.h"
12 14
13 #if !defined(DISABLE_NACL) 15 #if !defined(DISABLE_NACL)
14 #include "base/command_line.h" 16 #include "base/command_line.h"
15 #include "chrome/common/chrome_switches.h" 17 #include "chrome/common/chrome_switches.h"
16 #include "components/nacl/common/nacl_switches.h" 18 #include "components/nacl/common/nacl_switches.h"
17 #include "native_client/src/trusted/service_runtime/osx/crash_filter.h" 19 #include "native_client/src/trusted/service_runtime/osx/crash_filter.h"
18 #endif 20 #endif
19 21
22 bool ChromeCrashReporterClient::GetCrashMetricsLocation(
23 base::FilePath* metrics_dir) {
24 #if defined(GOOGLE_CHROME_BUILD)
scottmg 2017/01/05 22:41:40 The #if feels like unnecessary clutter here.
25 return PathService::Get(chrome::DIR_USER_DATA, metrics_dir);
26 #else
27 return false;
28 #endif
29 }
30
20 bool ChromeCrashReporterClient::ReportingIsEnforcedByPolicy( 31 bool ChromeCrashReporterClient::ReportingIsEnforcedByPolicy(
21 bool* breakpad_enabled) { 32 bool* breakpad_enabled) {
22 base::ScopedCFTypeRef<CFStringRef> key( 33 base::ScopedCFTypeRef<CFStringRef> key(
23 base::SysUTF8ToCFStringRef(policy::key::kMetricsReportingEnabled)); 34 base::SysUTF8ToCFStringRef(policy::key::kMetricsReportingEnabled));
24 Boolean key_valid; 35 Boolean key_valid;
25 Boolean metrics_reporting_enabled = CFPreferencesGetAppBooleanValue(key, 36 Boolean metrics_reporting_enabled = CFPreferencesGetAppBooleanValue(key,
26 kCFPreferencesCurrentApplication, &key_valid); 37 kCFPreferencesCurrentApplication, &key_valid);
27 if (key_valid && 38 if (key_valid &&
28 CFPreferencesAppValueIsForced(key, kCFPreferencesCurrentApplication)) { 39 CFPreferencesAppValueIsForced(key, kCFPreferencesCurrentApplication)) {
29 *breakpad_enabled = metrics_reporting_enabled; 40 *breakpad_enabled = metrics_reporting_enabled;
30 return true; 41 return true;
31 } 42 }
32 return false; 43 return false;
33 } 44 }
OLDNEW
« no previous file with comments | « chrome/app/chrome_crash_reporter_client.h ('k') | chrome/app/chrome_crash_reporter_client_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698