Loading metricsd/metrics_daemon.cc +8 −6 Original line number Original line Diff line number Diff line Loading @@ -326,7 +326,7 @@ void MetricsDaemon::OnShutdown(int* return_code) { } } void MetricsDaemon::OnWeaveCommand(CommandProxy* command) { void MetricsDaemon::OnWeaveCommand(CommandProxy* command) { if (command->category() != "metrics" || command->status() != "queued") { if (command->state() != "queued") { return; return; } } Loading @@ -342,24 +342,26 @@ void MetricsDaemon::OnEnableMetrics(CommandProxy* command) { if (base::WriteFile(metrics_directory_.Append(metrics::kConsentFileName), if (base::WriteFile(metrics_directory_.Append(metrics::kConsentFileName), "", 0) != 0) { "", 0) != 0) { PLOG(ERROR) << "Could not create the consent file."; PLOG(ERROR) << "Could not create the consent file."; command->Abort(nullptr); command->Abort("metrics_error", "Could not create the consent file", nullptr); return; return; } } NotifyStateChanged(); NotifyStateChanged(); command->Done(nullptr); command->Complete({}, nullptr); } } void MetricsDaemon::OnDisableMetrics(CommandProxy* command) { void MetricsDaemon::OnDisableMetrics(CommandProxy* command) { if (!base::DeleteFile(metrics_directory_.Append(metrics::kConsentFileName), if (!base::DeleteFile(metrics_directory_.Append(metrics::kConsentFileName), false)) { false)) { PLOG(ERROR) << "Cound not delete the consent file."; PLOG(ERROR) << "Could not delete the consent file."; command->Abort(nullptr); command->Abort("metrics_error", "Could not delete the consent file", nullptr); return; return; } } NotifyStateChanged(); NotifyStateChanged(); command->Done(nullptr); command->Complete({}, nullptr); } } void MetricsDaemon::NotifyStateChanged() { void MetricsDaemon::NotifyStateChanged() { Loading Loading
metricsd/metrics_daemon.cc +8 −6 Original line number Original line Diff line number Diff line Loading @@ -326,7 +326,7 @@ void MetricsDaemon::OnShutdown(int* return_code) { } } void MetricsDaemon::OnWeaveCommand(CommandProxy* command) { void MetricsDaemon::OnWeaveCommand(CommandProxy* command) { if (command->category() != "metrics" || command->status() != "queued") { if (command->state() != "queued") { return; return; } } Loading @@ -342,24 +342,26 @@ void MetricsDaemon::OnEnableMetrics(CommandProxy* command) { if (base::WriteFile(metrics_directory_.Append(metrics::kConsentFileName), if (base::WriteFile(metrics_directory_.Append(metrics::kConsentFileName), "", 0) != 0) { "", 0) != 0) { PLOG(ERROR) << "Could not create the consent file."; PLOG(ERROR) << "Could not create the consent file."; command->Abort(nullptr); command->Abort("metrics_error", "Could not create the consent file", nullptr); return; return; } } NotifyStateChanged(); NotifyStateChanged(); command->Done(nullptr); command->Complete({}, nullptr); } } void MetricsDaemon::OnDisableMetrics(CommandProxy* command) { void MetricsDaemon::OnDisableMetrics(CommandProxy* command) { if (!base::DeleteFile(metrics_directory_.Append(metrics::kConsentFileName), if (!base::DeleteFile(metrics_directory_.Append(metrics::kConsentFileName), false)) { false)) { PLOG(ERROR) << "Cound not delete the consent file."; PLOG(ERROR) << "Could not delete the consent file."; command->Abort(nullptr); command->Abort("metrics_error", "Could not delete the consent file", nullptr); return; return; } } NotifyStateChanged(); NotifyStateChanged(); command->Done(nullptr); command->Complete({}, nullptr); } } void MetricsDaemon::NotifyStateChanged() { void MetricsDaemon::NotifyStateChanged() { Loading