Chromium Code Reviews| Index: chromeos/dbus/fake_leadership_daemon_manager_client.cc |
| diff --git a/chromeos/dbus/fake_leadership_daemon_manager_client.cc b/chromeos/dbus/fake_leadership_daemon_manager_client.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e285a95f7b0527ec9d43c975e307dc02c8932aba |
| --- /dev/null |
| +++ b/chromeos/dbus/fake_leadership_daemon_manager_client.cc |
| @@ -0,0 +1,78 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chromeos/dbus/fake_leadership_daemon_manager_client.h" |
| + |
| +#include "base/message_loop/message_loop.h" |
| + |
| +namespace chromeos { |
| + |
| +namespace { |
|
stevenjb
2015/02/13 18:53:19
bit: blank line here
|
| +void StringDBBusMethodCallbackThunk(const StringDBusMethodCallback& callback) { |
| + callback.Run(DBUS_METHOD_CALL_SUCCESS, std::string()); |
| +} |
| + |
| +void VoidDBBusMethodCallbackThunk(const VoidDBusMethodCallback& callback) { |
| + callback.Run(DBUS_METHOD_CALL_SUCCESS); |
| +} |
| +} |
|
stevenjb
2015/02/13 18:53:19
nit: // namespace + blank line before
|
| + |
| +FakeLeadershipDaemonManagerClient::FakeLeadershipDaemonManagerClient() { |
| +} |
| + |
| +FakeLeadershipDaemonManagerClient::~FakeLeadershipDaemonManagerClient() { |
| +} |
| + |
| +void FakeLeadershipDaemonManagerClient::Init(dbus::Bus* bus) { |
| +} |
| + |
| +void FakeLeadershipDaemonManagerClient::AddObserver(Observer* observer) { |
| +} |
| + |
| +void FakeLeadershipDaemonManagerClient::RemoveObserver(Observer* observer) { |
| +} |
| + |
| +void FakeLeadershipDaemonManagerClient::JoinGroup( |
| + const std::string& group, |
| + const base::DictionaryValue& options, |
| + const StringDBusMethodCallback& callback) { |
| + base::MessageLoop::current()->PostTask( |
| + FROM_HERE, base::Bind(&StringDBBusMethodCallbackThunk, callback)); |
| +} |
| + |
| +void FakeLeadershipDaemonManagerClient::LeaveGroup( |
| + const std::string& object_path, |
| + const VoidDBusMethodCallback& callback) { |
| + base::MessageLoop::current()->PostTask( |
| + FROM_HERE, base::Bind(&VoidDBBusMethodCallbackThunk, callback)); |
| +} |
| + |
| +void FakeLeadershipDaemonManagerClient::SetScore( |
| + const std::string& object_path, |
| + int score, |
| + const VoidDBusMethodCallback& callback) { |
| + base::MessageLoop::current()->PostTask( |
| + FROM_HERE, base::Bind(&VoidDBBusMethodCallbackThunk, callback)); |
| +} |
| + |
| +void FakeLeadershipDaemonManagerClient::PokeLeader( |
| + const std::string& object_path, |
| + const VoidDBusMethodCallback& callback) { |
| + base::MessageLoop::current()->PostTask( |
| + FROM_HERE, base::Bind(&VoidDBBusMethodCallbackThunk, callback)); |
| +} |
| + |
| +void FakeLeadershipDaemonManagerClient::Ping( |
| + const StringDBusMethodCallback& callback) { |
| + base::MessageLoop::current()->PostTask( |
| + FROM_HERE, base::Bind(&StringDBBusMethodCallbackThunk, callback)); |
| +} |
| + |
| +const LeadershipDaemonManagerClient::GroupProperties* |
| +FakeLeadershipDaemonManagerClient::GetGroupProperties( |
| + const dbus::ObjectPath& object_path) { |
| + return nullptr; |
| +} |
| + |
| +} // namespace chromeos |