Commit d5d66db6 authored by Peter K. Lee's avatar Peter K. Lee Committed by Commit Bot

Removed unused code for background uploaded crash dumps.

This code should have been removed as part of http://crrev/c/832942

Bug: 795802
Change-Id: I6d087c8f2cfc8c955db8ca757feded7379b7b6a6
Reviewed-on: https://chromium-review.googlesource.com/c/1312299Reviewed-by: default avatarJustin Cohen <justincohen@chromium.org>
Commit-Queue: Peter Lee <pkl@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604590}
parent f9cb2910
...@@ -49,12 +49,6 @@ class MobileSessionShutdownMetricsProvider : public metrics::MetricsProvider { ...@@ -49,12 +49,6 @@ class MobileSessionShutdownMetricsProvider : public metrics::MetricsProvider {
// Whether there are crash reports to upload. // Whether there are crash reports to upload.
virtual bool HasCrashLogs(); virtual bool HasCrashLogs();
// Whether there were crash reports that have been uploaded in background
// since the last full start.
// TODO(crbug.com/795802): This method should be removed now that
// Crash Reports are no longer being uploaded in the background.
virtual bool HasUploadedCrashReportsInBackground();
// Whether there was a memory warning shortly before last shutdown. // Whether there was a memory warning shortly before last shutdown.
virtual bool ReceivedMemoryWarningBeforeLastShutdown(); virtual bool ReceivedMemoryWarningBeforeLastShutdown();
......
...@@ -57,16 +57,14 @@ void MobileSessionShutdownMetricsProvider::ProvidePreviousSessionData( ...@@ -57,16 +57,14 @@ void MobileSessionShutdownMetricsProvider::ProvidePreviousSessionData(
// If the last app lifetime ended in a crash, log the type of crash. // If the last app lifetime ended in a crash, log the type of crash.
MobileSessionShutdownType shutdown_type; MobileSessionShutdownType shutdown_type;
const bool with_crash_log =
HasUploadedCrashReportsInBackground() || HasCrashLogs();
if (ReceivedMemoryWarningBeforeLastShutdown()) { if (ReceivedMemoryWarningBeforeLastShutdown()) {
if (with_crash_log) { if (HasCrashLogs()) {
shutdown_type = SHUTDOWN_IN_FOREGROUND_WITH_CRASH_LOG_WITH_MEMORY_WARNING; shutdown_type = SHUTDOWN_IN_FOREGROUND_WITH_CRASH_LOG_WITH_MEMORY_WARNING;
} else { } else {
shutdown_type = SHUTDOWN_IN_FOREGROUND_NO_CRASH_LOG_WITH_MEMORY_WARNING; shutdown_type = SHUTDOWN_IN_FOREGROUND_NO_CRASH_LOG_WITH_MEMORY_WARNING;
} }
} else { } else {
if (with_crash_log) { if (HasCrashLogs()) {
shutdown_type = SHUTDOWN_IN_FOREGROUND_WITH_CRASH_LOG_NO_MEMORY_WARNING; shutdown_type = SHUTDOWN_IN_FOREGROUND_WITH_CRASH_LOG_NO_MEMORY_WARNING;
} else { } else {
shutdown_type = SHUTDOWN_IN_FOREGROUND_NO_CRASH_LOG_NO_MEMORY_WARNING; shutdown_type = SHUTDOWN_IN_FOREGROUND_NO_CRASH_LOG_NO_MEMORY_WARNING;
...@@ -83,11 +81,6 @@ bool MobileSessionShutdownMetricsProvider::HasCrashLogs() { ...@@ -83,11 +81,6 @@ bool MobileSessionShutdownMetricsProvider::HasCrashLogs() {
return breakpad_helper::HasReportToUpload(); return breakpad_helper::HasReportToUpload();
} }
bool MobileSessionShutdownMetricsProvider::
HasUploadedCrashReportsInBackground() {
return false;
}
bool MobileSessionShutdownMetricsProvider:: bool MobileSessionShutdownMetricsProvider::
ReceivedMemoryWarningBeforeLastShutdown() { ReceivedMemoryWarningBeforeLastShutdown() {
return [[PreviousSessionInfo sharedInstance] return [[PreviousSessionInfo sharedInstance]
......
...@@ -38,9 +38,6 @@ class MobileSessionShutdownMetricsProviderForTesting ...@@ -38,9 +38,6 @@ class MobileSessionShutdownMetricsProviderForTesting
is_first_launch_after_upgrade_ = value; is_first_launch_after_upgrade_ = value;
} }
void set_has_crash_logs(bool value) { has_crash_logs_ = value; } void set_has_crash_logs(bool value) { has_crash_logs_ = value; }
void set_has_uploaded_crash_reports_in_background(bool value) {
has_uploaded_crash_reports_in_background_ = value;
}
void set_received_memory_warning_before_last_shutdown(bool value) { void set_received_memory_warning_before_last_shutdown(bool value) {
received_memory_warning_before_last_shutdown_ = value; received_memory_warning_before_last_shutdown_ = value;
} }
...@@ -51,9 +48,6 @@ class MobileSessionShutdownMetricsProviderForTesting ...@@ -51,9 +48,6 @@ class MobileSessionShutdownMetricsProviderForTesting
return is_first_launch_after_upgrade_; return is_first_launch_after_upgrade_;
} }
bool HasCrashLogs() override { return has_crash_logs_; } bool HasCrashLogs() override { return has_crash_logs_; }
bool HasUploadedCrashReportsInBackground() override {
return has_uploaded_crash_reports_in_background_;
}
bool ReceivedMemoryWarningBeforeLastShutdown() override { bool ReceivedMemoryWarningBeforeLastShutdown() override {
return received_memory_warning_before_last_shutdown_; return received_memory_warning_before_last_shutdown_;
} }
...@@ -61,7 +55,6 @@ class MobileSessionShutdownMetricsProviderForTesting ...@@ -61,7 +55,6 @@ class MobileSessionShutdownMetricsProviderForTesting
private: private:
bool is_first_launch_after_upgrade_; bool is_first_launch_after_upgrade_;
bool has_crash_logs_; bool has_crash_logs_;
bool has_uploaded_crash_reports_in_background_;
bool received_memory_warning_before_last_shutdown_; bool received_memory_warning_before_last_shutdown_;
DISALLOW_COPY_AND_ASSIGN(MobileSessionShutdownMetricsProviderForTesting); DISALLOW_COPY_AND_ASSIGN(MobileSessionShutdownMetricsProviderForTesting);
...@@ -96,15 +89,13 @@ class MobileSessionShutdownMetricsProviderTest ...@@ -96,15 +89,13 @@ class MobileSessionShutdownMetricsProviderTest
// most significant): // most significant):
// - received memory warning; // - received memory warning;
// - crash log present; // - crash log present;
// - uploaded crash reports in background;
// - last shutdown was clean; // - last shutdown was clean;
// - first launch after upgrade. // - first launch after upgrade.
TEST_P(MobileSessionShutdownMetricsProviderTest, ProvideStabilityMetrics) { TEST_P(MobileSessionShutdownMetricsProviderTest, ProvideStabilityMetrics) {
const bool received_memory_warning = GetParam() % 2; const bool received_memory_warning = GetParam() % 2;
const bool has_crash_logs = (GetParam() >> 1) % 2; const bool has_crash_logs = (GetParam() >> 1) % 2;
const bool has_uploaded_crash_reports_in_background = (GetParam() >> 2) % 2; const bool was_last_shutdown_clean = (GetParam() >> 2) % 2;
const bool was_last_shutdown_clean = (GetParam() >> 3) % 2; const bool is_first_launch_after_upgrade = (GetParam() >> 3) % 2;
const bool is_first_launch_after_upgrade = (GetParam() >> 4) % 2;
// Expected bucket for each possible value of GetParam(). // Expected bucket for each possible value of GetParam().
const MobileSessionShutdownType expected_buckets[] = { const MobileSessionShutdownType expected_buckets[] = {
...@@ -112,20 +103,12 @@ TEST_P(MobileSessionShutdownMetricsProviderTest, ProvideStabilityMetrics) { ...@@ -112,20 +103,12 @@ TEST_P(MobileSessionShutdownMetricsProviderTest, ProvideStabilityMetrics) {
SHUTDOWN_IN_FOREGROUND_NO_CRASH_LOG_WITH_MEMORY_WARNING, SHUTDOWN_IN_FOREGROUND_NO_CRASH_LOG_WITH_MEMORY_WARNING,
SHUTDOWN_IN_FOREGROUND_WITH_CRASH_LOG_NO_MEMORY_WARNING, SHUTDOWN_IN_FOREGROUND_WITH_CRASH_LOG_NO_MEMORY_WARNING,
SHUTDOWN_IN_FOREGROUND_WITH_CRASH_LOG_WITH_MEMORY_WARNING, SHUTDOWN_IN_FOREGROUND_WITH_CRASH_LOG_WITH_MEMORY_WARNING,
SHUTDOWN_IN_FOREGROUND_WITH_CRASH_LOG_NO_MEMORY_WARNING,
SHUTDOWN_IN_FOREGROUND_WITH_CRASH_LOG_WITH_MEMORY_WARNING,
SHUTDOWN_IN_FOREGROUND_WITH_CRASH_LOG_NO_MEMORY_WARNING,
SHUTDOWN_IN_FOREGROUND_WITH_CRASH_LOG_WITH_MEMORY_WARNING,
// If wasLastShutdownClean is true, the memory warning and crash log don't // If wasLastShutdownClean is true, the memory warning and crash log don't
// matter. // matter.
SHUTDOWN_IN_BACKGROUND, SHUTDOWN_IN_BACKGROUND,
SHUTDOWN_IN_BACKGROUND, SHUTDOWN_IN_BACKGROUND,
SHUTDOWN_IN_BACKGROUND, SHUTDOWN_IN_BACKGROUND,
SHUTDOWN_IN_BACKGROUND, SHUTDOWN_IN_BACKGROUND,
SHUTDOWN_IN_BACKGROUND,
SHUTDOWN_IN_BACKGROUND,
SHUTDOWN_IN_BACKGROUND,
SHUTDOWN_IN_BACKGROUND,
// If firstLaunchAfterUpgrade is true, the other flags don't matter. // If firstLaunchAfterUpgrade is true, the other flags don't matter.
FIRST_LAUNCH_AFTER_UPGRADE, FIRST_LAUNCH_AFTER_UPGRADE,
FIRST_LAUNCH_AFTER_UPGRADE, FIRST_LAUNCH_AFTER_UPGRADE,
...@@ -135,14 +118,6 @@ TEST_P(MobileSessionShutdownMetricsProviderTest, ProvideStabilityMetrics) { ...@@ -135,14 +118,6 @@ TEST_P(MobileSessionShutdownMetricsProviderTest, ProvideStabilityMetrics) {
FIRST_LAUNCH_AFTER_UPGRADE, FIRST_LAUNCH_AFTER_UPGRADE,
FIRST_LAUNCH_AFTER_UPGRADE, FIRST_LAUNCH_AFTER_UPGRADE,
FIRST_LAUNCH_AFTER_UPGRADE, FIRST_LAUNCH_AFTER_UPGRADE,
FIRST_LAUNCH_AFTER_UPGRADE,
FIRST_LAUNCH_AFTER_UPGRADE,
FIRST_LAUNCH_AFTER_UPGRADE,
FIRST_LAUNCH_AFTER_UPGRADE,
FIRST_LAUNCH_AFTER_UPGRADE,
FIRST_LAUNCH_AFTER_UPGRADE,
FIRST_LAUNCH_AFTER_UPGRADE,
FIRST_LAUNCH_AFTER_UPGRADE,
}; };
// Setup the MetricsService. // Setup the MetricsService.
...@@ -165,8 +140,6 @@ TEST_P(MobileSessionShutdownMetricsProviderTest, ProvideStabilityMetrics) { ...@@ -165,8 +140,6 @@ TEST_P(MobileSessionShutdownMetricsProviderTest, ProvideStabilityMetrics) {
metrics_provider_->set_received_memory_warning_before_last_shutdown( metrics_provider_->set_received_memory_warning_before_last_shutdown(
received_memory_warning); received_memory_warning);
metrics_provider_->set_has_crash_logs(has_crash_logs); metrics_provider_->set_has_crash_logs(has_crash_logs);
metrics_provider_->set_has_uploaded_crash_reports_in_background(
has_uploaded_crash_reports_in_background);
// Create a histogram tester for verifying samples written to the shutdown // Create a histogram tester for verifying samples written to the shutdown
// type histogram. // type histogram.
...@@ -181,4 +154,4 @@ TEST_P(MobileSessionShutdownMetricsProviderTest, ProvideStabilityMetrics) { ...@@ -181,4 +154,4 @@ TEST_P(MobileSessionShutdownMetricsProviderTest, ProvideStabilityMetrics) {
INSTANTIATE_TEST_CASE_P(/* No InstantiationName */, INSTANTIATE_TEST_CASE_P(/* No InstantiationName */,
MobileSessionShutdownMetricsProviderTest, MobileSessionShutdownMetricsProviderTest,
testing::Range(0, 32)); testing::Range(0, 16));
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