| Index: chrome/browser/component_updater/sw_reporter_installer_win.cc
|
| diff --git a/chrome/browser/component_updater/sw_reporter_installer_win.cc b/chrome/browser/component_updater/sw_reporter_installer_win.cc
|
| index ade986db33e4ffaf1e2bb32dfd5bef74990646f9..4129c6062d9e84418d51f0fef5ed605166025a7a 100644
|
| --- a/chrome/browser/component_updater/sw_reporter_installer_win.cc
|
| +++ b/chrome/browser/component_updater/sw_reporter_installer_win.cc
|
| @@ -94,9 +94,7 @@
|
|
|
| // Exit codes that identify that a cleanup is needed.
|
| const int kCleanupNeeded = 0;
|
| -const int kNothingFound = 2;
|
| const int kPostRebootCleanupNeeded = 4;
|
| -const int kDelayedPostRebootCleanupNeeded = 15;
|
|
|
| void ReportUmaStep(SwReporterUmaValue value) {
|
| UMA_HISTOGRAM_ENUMERATION("SoftwareReporter.Step", value, SW_REPORTER_MAX);
|
| @@ -116,14 +114,14 @@
|
| // The major version for X.Y.Z is X*256^3+Y*256+Z. If there are additional
|
| // components, only the first three count, and if there are less than 3, the
|
| // missing values are just replaced by zero. So 1 is equivalent 1.0.0.
|
| - DCHECK_LT(version.components()[0], 0x100);
|
| + DCHECK(version.components()[0] < 0x100);
|
| uint32_t major_version = 0x1000000 * version.components()[0];
|
| if (version.components().size() >= 2) {
|
| - DCHECK_LT(version.components()[1], 0x10000);
|
| + DCHECK(version.components()[1] < 0x10000);
|
| major_version += 0x100 * version.components()[1];
|
| }
|
| if (version.components().size() >= 3) {
|
| - DCHECK_LT(version.components()[2], 0x100);
|
| + DCHECK(version.components()[2] < 0x100);
|
| major_version += version.components()[2];
|
| }
|
| UMA_HISTOGRAM_SPARSE_SLOWLY("SoftwareReporter.MajorVersion", major_version);
|
| @@ -354,13 +352,12 @@
|
| cleaner_key.DeleteValue(kVersionRegistryValueName);
|
| }
|
| // Get start & end time. If we don't have an end time, we can assume the
|
| - // cleaner has not completed.
|
| - int64 start_time_value;
|
| - cleaner_key.ReadInt64(kStartTimeRegistryValueName, &start_time_value);
|
| -
|
| + // cleaner has crashed.
|
| bool completed = cleaner_key.HasValue(kEndTimeRegistryValueName);
|
| UMA_HISTOGRAM_BOOLEAN("SoftwareReporter.Cleaner.HasCompleted", completed);
|
| if (completed) {
|
| + int64 start_time_value;
|
| + cleaner_key.ReadInt64(kStartTimeRegistryValueName, &start_time_value);
|
| int64 end_time_value;
|
| cleaner_key.ReadInt64(kEndTimeRegistryValueName, &end_time_value);
|
| cleaner_key.DeleteValue(kEndTimeRegistryValueName);
|
| @@ -369,26 +366,15 @@
|
| UMA_HISTOGRAM_LONG_TIMES("SoftwareReporter.Cleaner.RunningTime",
|
| run_time);
|
| }
|
| - // Get exit code. Assume nothing was found if we can't read the exit code.
|
| - DWORD exit_code = kNothingFound;
|
| + // Get exit code.
|
| if (cleaner_key.HasValue(kExitCodeRegistryValueName)) {
|
| + DWORD exit_code;
|
| cleaner_key.ReadValueDW(kExitCodeRegistryValueName, &exit_code);
|
| UMA_HISTOGRAM_SPARSE_SLOWLY("SoftwareReporter.Cleaner.ExitCode",
|
| exit_code);
|
| cleaner_key.DeleteValue(kExitCodeRegistryValueName);
|
| }
|
| cleaner_key.DeleteValue(kStartTimeRegistryValueName);
|
| -
|
| - if (exit_code == kPostRebootCleanupNeeded ||
|
| - exit_code == kDelayedPostRebootCleanupNeeded) {
|
| - // Check if we are running after the user has rebooted.
|
| - base::TimeDelta elapsed(base::Time::Now() -
|
| - base::Time::FromInternalValue(start_time_value));
|
| - DCHECK_GT(elapsed.InMilliseconds(), 0);
|
| - UMA_HISTOGRAM_BOOLEAN(
|
| - "SoftwareReporter.Cleaner.HasRebooted",
|
| - static_cast<uint64>(elapsed.InMilliseconds()) > ::GetTickCount64());
|
| - }
|
| }
|
|
|
| // Install the component.
|
|
|