OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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/fake_leadership_daemon_manager_client.h" | 5 #include "chromeos/dbus/fake_leadership_daemon_manager_client.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 | 8 |
9 namespace chromeos { | 9 namespace chromeos { |
10 | 10 |
11 namespace { | 11 namespace { |
12 void StringDBBusMethodCallbackThunk(const StringDBusMethodCallback& callback) { | 12 void StringDBBusMethodCallbackThunk(const StringDBusMethodCallback& callback) { |
13 callback.Run(DBUS_METHOD_CALL_SUCCESS, std::string()); | 13 callback.Run(DBUS_METHOD_CALL_SUCCESS, std::string()); |
14 } | 14 } |
15 | 15 |
16 void ObjectPathDBBusMethodCallbackThunk( | |
17 const ObjectPathDBusMethodCallback& callback) { | |
18 callback.Run(DBUS_METHOD_CALL_SUCCESS, dbus::ObjectPath()); | |
19 } | |
20 | |
16 void VoidDBBusMethodCallbackThunk(const VoidDBusMethodCallback& callback) { | 21 void VoidDBBusMethodCallbackThunk(const VoidDBusMethodCallback& callback) { |
17 callback.Run(DBUS_METHOD_CALL_SUCCESS); | 22 callback.Run(DBUS_METHOD_CALL_SUCCESS); |
18 } | 23 } |
19 } | 24 } |
hashimoto
2015/03/03 14:53:10
nit: Please add "// namespace" here while you are
| |
20 | 25 |
21 FakeLeadershipDaemonManagerClient::FakeLeadershipDaemonManagerClient() { | 26 FakeLeadershipDaemonManagerClient::FakeLeadershipDaemonManagerClient() { |
22 } | 27 } |
23 | 28 |
24 FakeLeadershipDaemonManagerClient::~FakeLeadershipDaemonManagerClient() { | 29 FakeLeadershipDaemonManagerClient::~FakeLeadershipDaemonManagerClient() { |
25 } | 30 } |
26 | 31 |
27 void FakeLeadershipDaemonManagerClient::Init(dbus::Bus* bus) { | 32 void FakeLeadershipDaemonManagerClient::Init(dbus::Bus* bus) { |
28 } | 33 } |
29 | 34 |
30 void FakeLeadershipDaemonManagerClient::AddObserver(Observer* observer) { | 35 void FakeLeadershipDaemonManagerClient::AddObserver(Observer* observer) { |
31 } | 36 } |
32 | 37 |
33 void FakeLeadershipDaemonManagerClient::RemoveObserver(Observer* observer) { | 38 void FakeLeadershipDaemonManagerClient::RemoveObserver(Observer* observer) { |
34 } | 39 } |
35 | 40 |
36 void FakeLeadershipDaemonManagerClient::JoinGroup( | 41 void FakeLeadershipDaemonManagerClient::JoinGroup( |
37 const std::string& group, | 42 const std::string& group, |
38 const base::DictionaryValue& options, | 43 const base::DictionaryValue& options, |
39 const StringDBusMethodCallback& callback) { | 44 const ObjectPathDBusMethodCallback& callback) { |
40 base::MessageLoop::current()->PostTask( | 45 base::MessageLoop::current()->PostTask( |
41 FROM_HERE, base::Bind(&StringDBBusMethodCallbackThunk, callback)); | 46 FROM_HERE, base::Bind(&ObjectPathDBBusMethodCallbackThunk, callback)); |
42 } | 47 } |
43 | 48 |
44 void FakeLeadershipDaemonManagerClient::LeaveGroup( | 49 void FakeLeadershipDaemonManagerClient::LeaveGroup( |
45 const std::string& object_path, | 50 const std::string& object_path, |
46 const VoidDBusMethodCallback& callback) { | 51 const VoidDBusMethodCallback& callback) { |
47 base::MessageLoop::current()->PostTask( | 52 base::MessageLoop::current()->PostTask( |
48 FROM_HERE, base::Bind(&VoidDBBusMethodCallbackThunk, callback)); | 53 FROM_HERE, base::Bind(&VoidDBBusMethodCallbackThunk, callback)); |
49 } | 54 } |
50 | 55 |
51 void FakeLeadershipDaemonManagerClient::SetScore( | 56 void FakeLeadershipDaemonManagerClient::SetScore( |
(...skipping 17 matching lines...) Expand all Loading... | |
69 FROM_HERE, base::Bind(&StringDBBusMethodCallbackThunk, callback)); | 74 FROM_HERE, base::Bind(&StringDBBusMethodCallbackThunk, callback)); |
70 } | 75 } |
71 | 76 |
72 const LeadershipDaemonManagerClient::GroupProperties* | 77 const LeadershipDaemonManagerClient::GroupProperties* |
73 FakeLeadershipDaemonManagerClient::GetGroupProperties( | 78 FakeLeadershipDaemonManagerClient::GetGroupProperties( |
74 const dbus::ObjectPath& object_path) { | 79 const dbus::ObjectPath& object_path) { |
75 return nullptr; | 80 return nullptr; |
76 } | 81 } |
77 | 82 |
78 } // namespace chromeos | 83 } // namespace chromeos |
OLD | NEW |