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

Side by Side 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: Fix nits 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chromeos/dbus/fake_leadership_daemon_manager_client.h"
6
7 #include "base/message_loop/message_loop.h"
8
9 namespace chromeos {
10
11 namespace {
stevenjb 2015/02/13 18:53:19 bit: blank line here
12 void StringDBBusMethodCallbackThunk(const StringDBusMethodCallback& callback) {
13 callback.Run(DBUS_METHOD_CALL_SUCCESS, std::string());
14 }
15
16 void VoidDBBusMethodCallbackThunk(const VoidDBusMethodCallback& callback) {
17 callback.Run(DBUS_METHOD_CALL_SUCCESS);
18 }
19 }
stevenjb 2015/02/13 18:53:19 nit: // namespace + blank line before
20
21 FakeLeadershipDaemonManagerClient::FakeLeadershipDaemonManagerClient() {
22 }
23
24 FakeLeadershipDaemonManagerClient::~FakeLeadershipDaemonManagerClient() {
25 }
26
27 void FakeLeadershipDaemonManagerClient::Init(dbus::Bus* bus) {
28 }
29
30 void FakeLeadershipDaemonManagerClient::AddObserver(Observer* observer) {
31 }
32
33 void FakeLeadershipDaemonManagerClient::RemoveObserver(Observer* observer) {
34 }
35
36 void FakeLeadershipDaemonManagerClient::JoinGroup(
37 const std::string& group,
38 const base::DictionaryValue& options,
39 const StringDBusMethodCallback& callback) {
40 base::MessageLoop::current()->PostTask(
41 FROM_HERE, base::Bind(&StringDBBusMethodCallbackThunk, callback));
42 }
43
44 void FakeLeadershipDaemonManagerClient::LeaveGroup(
45 const std::string& object_path,
46 const VoidDBusMethodCallback& callback) {
47 base::MessageLoop::current()->PostTask(
48 FROM_HERE, base::Bind(&VoidDBBusMethodCallbackThunk, callback));
49 }
50
51 void FakeLeadershipDaemonManagerClient::SetScore(
52 const std::string& object_path,
53 int score,
54 const VoidDBusMethodCallback& callback) {
55 base::MessageLoop::current()->PostTask(
56 FROM_HERE, base::Bind(&VoidDBBusMethodCallbackThunk, callback));
57 }
58
59 void FakeLeadershipDaemonManagerClient::PokeLeader(
60 const std::string& object_path,
61 const VoidDBusMethodCallback& callback) {
62 base::MessageLoop::current()->PostTask(
63 FROM_HERE, base::Bind(&VoidDBBusMethodCallbackThunk, callback));
64 }
65
66 void FakeLeadershipDaemonManagerClient::Ping(
67 const StringDBusMethodCallback& callback) {
68 base::MessageLoop::current()->PostTask(
69 FROM_HERE, base::Bind(&StringDBBusMethodCallbackThunk, callback));
70 }
71
72 const LeadershipDaemonManagerClient::GroupProperties*
73 FakeLeadershipDaemonManagerClient::GetGroupProperties(
74 const dbus::ObjectPath& object_path) {
75 return nullptr;
76 }
77
78 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698