Commit c8e4f85c authored by mark's avatar mark Committed by Commit bot

Enable UMA reporting for crashpad_handler on macOS

This should have been working already, but a functioning
crash_reporter::CrashReporterClient::GetCrashMetricsLocation() for macOS
was unintentionally absent.

BUG=crashpad:100,chromium:678720

Review-Url: https://codereview.chromium.org/2610883006
Cr-Commit-Position: refs/heads/master@{#442888}
parent 5b86dfe6
...@@ -35,6 +35,10 @@ class ChromeCrashReporterClient : public crash_reporter::CrashReporterClient { ...@@ -35,6 +35,10 @@ class ChromeCrashReporterClient : public crash_reporter::CrashReporterClient {
bool GetCrashDumpLocation(base::FilePath* crash_dir) override; bool GetCrashDumpLocation(base::FilePath* crash_dir) override;
#if defined(OS_MACOSX)
bool GetCrashMetricsLocation(base::FilePath* metrics_dir) override;
#endif
size_t RegisterCrashKeys() override; size_t RegisterCrashKeys() override;
bool IsRunningUnattended() override; bool IsRunningUnattended() override;
......
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
#include <CoreFoundation/CoreFoundation.h> #include <CoreFoundation/CoreFoundation.h>
#include "base/mac/scoped_cftyperef.h" #include "base/mac/scoped_cftyperef.h"
#include "base/path_service.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#include "chrome/common/chrome_paths.h"
#include "components/policy/policy_constants.h" #include "components/policy/policy_constants.h"
#if !defined(DISABLE_NACL) #if !defined(DISABLE_NACL)
...@@ -17,6 +19,11 @@ ...@@ -17,6 +19,11 @@
#include "native_client/src/trusted/service_runtime/osx/crash_filter.h" #include "native_client/src/trusted/service_runtime/osx/crash_filter.h"
#endif #endif
bool ChromeCrashReporterClient::GetCrashMetricsLocation(
base::FilePath* metrics_dir) {
return PathService::Get(chrome::DIR_USER_DATA, metrics_dir);
}
bool ChromeCrashReporterClient::ReportingIsEnforcedByPolicy( bool ChromeCrashReporterClient::ReportingIsEnforcedByPolicy(
bool* breakpad_enabled) { bool* breakpad_enabled) {
base::ScopedCFTypeRef<CFStringRef> key( base::ScopedCFTypeRef<CFStringRef> key(
......
...@@ -37,7 +37,7 @@ class ChromeCrashReporterClient : public crash_reporter::CrashReporterClient { ...@@ -37,7 +37,7 @@ class ChromeCrashReporterClient : public crash_reporter::CrashReporterClient {
int GetResultCodeRespawnFailed() override; int GetResultCodeRespawnFailed() override;
bool GetCrashDumpLocation(base::string16* crash_dir) override; bool GetCrashDumpLocation(base::string16* crash_dir) override;
bool GetCrashMetricsLocation(base::string16* crash_dir) override; bool GetCrashMetricsLocation(base::string16* metrics_dir) override;
size_t RegisterCrashKeys() override; size_t RegisterCrashKeys() override;
......
...@@ -222,7 +222,7 @@ std::unique_ptr<metrics::FileMetricsProvider> CreateFileMetricsProvider( ...@@ -222,7 +222,7 @@ std::unique_ptr<metrics::FileMetricsProvider> CreateFileMetricsProvider(
// Register data that will be populated for the current run. // Register data that will be populated for the current run.
file_metrics_provider->RegisterSource( file_metrics_provider->RegisterSource(
active_path, active_path,
metrics::FileMetricsProvider::SOURCE_HISTOGRAMS_ATOMIC_FILE, metrics::FileMetricsProvider::SOURCE_HISTOGRAMS_ACTIVE_FILE,
metrics::FileMetricsProvider::ASSOCIATE_CURRENT_RUN, metrics::FileMetricsProvider::ASSOCIATE_CURRENT_RUN,
kCrashpadHistogramAllocatorName); kCrashpadHistogramAllocatorName);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment