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

Unified Diff: chromeos/dbus/update_engine_client.cc

Issue 2239513002: chromeos: Don't spam logs with update_engine D-Bus errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/update_engine_client.cc
diff --git a/chromeos/dbus/update_engine_client.cc b/chromeos/dbus/update_engine_client.cc
index bb78f668cf0fdde73db7df32f731636093549806..2abd1b02ab316b2b58f840494d02327486be7447 100644
--- a/chromeos/dbus/update_engine_client.cc
+++ b/chromeos/dbus/update_engine_client.cc
@@ -223,10 +223,6 @@ class UpdateEngineClientImpl : public UpdateEngineClient {
update_engine_proxy_ = bus->GetObjectProxy(
update_engine::kUpdateEngineServiceName,
dbus::ObjectPath(update_engine::kUpdateEngineServicePath));
-
- // Monitor the D-Bus signal for brightness changes. Only the power
- // manager knows the actual brightness level. We don't cache the
- // brightness level in Chrome as it will make things less reliable.
Daniel Erat 2016/08/10 21:56:18 hmm, i wonder where this code was copy-and-pasted
stevenjb 2016/08/10 22:24:21 Heh.
update_engine_proxy_->ConnectToSignal(
update_engine::kUpdateEngineInterface,
update_engine::kStatusUpdate,
@@ -234,15 +230,22 @@ class UpdateEngineClientImpl : public UpdateEngineClient {
weak_ptr_factory_.GetWeakPtr()),
base::Bind(&UpdateEngineClientImpl::StatusUpdateConnected,
weak_ptr_factory_.GetWeakPtr()));
-
- // Get update engine status for the initial status. Update engine won't
- // send StatusUpdate signal unless there is a status change. If chrome
- // crashes after UPDATE_STATUS_UPDATED_NEED_REBOOT status is set,
- // restarted chrome would not get this status. See crbug.com/154104.
- GetUpdateEngineStatus();
+ update_engine_proxy_->WaitForServiceToBeAvailable(
+ base::Bind(&UpdateEngineClientImpl::OnProxyAvailabilityChanged,
+ weak_ptr_factory_.GetWeakPtr()));
}
private:
+ void OnProxyAvailabilityChanged(bool service_is_available) {
Daniel Erat 2016/08/11 01:13:50 i misunderstood how WaitForServiceToBeAvailable ac
+ if (service_is_available) {
+ // Get update engine status for the initial status. Update engine won't
+ // send StatusUpdate signal unless there is a status change. If chrome
+ // crashes after UPDATE_STATUS_UPDATED_NEED_REBOOT status is set,
+ // restarted chrome would not get this status. See crbug.com/154104.
+ GetUpdateEngineStatus();
+ }
+ }
+
void GetUpdateEngineStatus() {
dbus::MethodCall method_call(
update_engine::kUpdateEngineInterface,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698