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

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

Issue 24673006: dbus: Stop accessing ObjectProxy::name_owner_changed_callback_ on the D-Bus thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « chromeos/dbus/cras_audio_client.cc ('k') | dbus/object_proxy.h » ('j') | 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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 // Make a method call to power manager with no arguments and no response. 331 // Make a method call to power manager with no arguments and no response.
332 void SimpleMethodCallToPowerManager(const std::string& method_name) { 332 void SimpleMethodCallToPowerManager(const std::string& method_name) {
333 dbus::MethodCall method_call(power_manager::kPowerManagerInterface, 333 dbus::MethodCall method_call(power_manager::kPowerManagerInterface,
334 method_name); 334 method_name);
335 power_manager_proxy_->CallMethod( 335 power_manager_proxy_->CallMethod(
336 &method_call, 336 &method_call,
337 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, 337 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
338 dbus::ObjectProxy::EmptyResponseCallback()); 338 dbus::ObjectProxy::EmptyResponseCallback());
339 } 339 }
340 340
341 void NameOwnerChangedReceived(dbus::Signal* signal) { 341 void NameOwnerChangedReceived(const std::string& old_owner,
342 const std::string& new_owner) {
342 VLOG(1) << "Power manager restarted"; 343 VLOG(1) << "Power manager restarted";
343 RegisterSuspendDelay(); 344 RegisterSuspendDelay();
344 SetIsProjecting(last_is_projecting_); 345 SetIsProjecting(last_is_projecting_);
345 FOR_EACH_OBSERVER(Observer, observers_, PowerManagerRestarted()); 346 FOR_EACH_OBSERVER(Observer, observers_, PowerManagerRestarted());
346 } 347 }
347 348
348 void BrightnessChangedReceived(dbus::Signal* signal) { 349 void BrightnessChangedReceived(dbus::Signal* signal) {
349 dbus::MessageReader reader(signal); 350 dbus::MessageReader reader(signal);
350 int32 brightness_level = 0; 351 int32 brightness_level = 0;
351 bool user_initiated = 0; 352 bool user_initiated = 0;
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 // static 862 // static
862 PowerManagerClient* PowerManagerClient::Create( 863 PowerManagerClient* PowerManagerClient::Create(
863 DBusClientImplementationType type) { 864 DBusClientImplementationType type) {
864 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) 865 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION)
865 return new PowerManagerClientImpl(); 866 return new PowerManagerClientImpl();
866 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); 867 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type);
867 return new PowerManagerClientStubImpl(); 868 return new PowerManagerClientStubImpl();
868 } 869 }
869 870
870 } // namespace chromeos 871 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/cras_audio_client.cc ('k') | dbus/object_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698