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

Side by Side Diff: chromeos/dbus/power_manager_client.cc

Issue 507803002: chromeos: Clear suspend state information if powerd restarts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromeos/dbus/power_manager_client.h" 5 #include "chromeos/dbus/power_manager_client.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, 340 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
341 dbus::ObjectProxy::EmptyResponseCallback()); 341 dbus::ObjectProxy::EmptyResponseCallback());
342 } 342 }
343 343
344 void NameOwnerChangedReceived(const std::string& old_owner, 344 void NameOwnerChangedReceived(const std::string& old_owner,
345 const std::string& new_owner) { 345 const std::string& new_owner) {
346 VLOG(1) << "Power manager restarted (old owner was " 346 VLOG(1) << "Power manager restarted (old owner was "
347 << (old_owner.empty() ? "[none]" : old_owner.c_str()) 347 << (old_owner.empty() ? "[none]" : old_owner.c_str())
348 << ", new owner is " 348 << ", new owner is "
349 << (new_owner.empty() ? "[none]" : new_owner.c_str()) << ")"; 349 << (new_owner.empty() ? "[none]" : new_owner.c_str()) << ")";
350 suspend_is_pending_ = false;
351 pending_suspend_id_ = -1;
352 suspending_from_dark_resume_ = false;
350 if (!new_owner.empty()) { 353 if (!new_owner.empty()) {
351 VLOG(1) << "Sending initial state to power manager"; 354 VLOG(1) << "Sending initial state to power manager";
352 RegisterSuspendDelays(); 355 RegisterSuspendDelays();
353 SetIsProjecting(last_is_projecting_); 356 SetIsProjecting(last_is_projecting_);
354 FOR_EACH_OBSERVER(Observer, observers_, PowerManagerRestarted()); 357 FOR_EACH_OBSERVER(Observer, observers_, PowerManagerRestarted());
355 } 358 }
356 } 359 }
357 360
358 void BrightnessChangedReceived(dbus::Signal* signal) { 361 void BrightnessChangedReceived(dbus::Signal* signal) {
359 dbus::MessageReader reader(signal); 362 dbus::MessageReader reader(signal);
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
951 // static 954 // static
952 PowerManagerClient* PowerManagerClient::Create( 955 PowerManagerClient* PowerManagerClient::Create(
953 DBusClientImplementationType type) { 956 DBusClientImplementationType type) {
954 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) 957 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION)
955 return new PowerManagerClientImpl(); 958 return new PowerManagerClientImpl();
956 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); 959 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type);
957 return new PowerManagerClientStubImpl(); 960 return new PowerManagerClientStubImpl();
958 } 961 }
959 962
960 } // namespace chromeos 963 } // namespace chromeos
OLDNEW
« 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