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

Unified Diff: chromeos/dbus/fake_leadership_daemon_manager_client.cc

Issue 887083002: Add DBus Bindings for leaderd (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ctl-X Ctl-S saves your work dave... Created 5 years, 10 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
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 {
+void StringDBBusMethodCallbackThunk(const StringDBusMethodCallback& callback) {
+ callback.Run(DBUS_METHOD_CALL_SUCCESS, std::string());
+}
+
+void VoidDBBusMethodCallbackThunk(const VoidDBusMethodCallback& callback) {
+ callback.Run(DBUS_METHOD_CALL_SUCCESS);
+}
+}
+
+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
« no previous file with comments | « chromeos/dbus/fake_leadership_daemon_manager_client.h ('k') | chromeos/dbus/leadership_daemon_manager_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698