OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_debug_daemon_client.h" | 5 #include "chromeos/dbus/fake_debug_daemon_client.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 base::File file, | 31 base::File file, |
32 scoped_refptr<base::TaskRunner> task_runner, | 32 scoped_refptr<base::TaskRunner> task_runner, |
33 const GetDebugLogsCallback& callback) { | 33 const GetDebugLogsCallback& callback) { |
34 callback.Run(true); | 34 callback.Run(true); |
35 } | 35 } |
36 | 36 |
37 void FakeDebugDaemonClient::SetDebugMode(const std::string& subsystem, | 37 void FakeDebugDaemonClient::SetDebugMode(const std::string& subsystem, |
38 const SetDebugModeCallback& callback) { | 38 const SetDebugModeCallback& callback) { |
39 callback.Run(false); | 39 callback.Run(false); |
40 } | 40 } |
41 void FakeDebugDaemonClient::StartSystemTracing() {} | |
42 | 41 |
43 bool FakeDebugDaemonClient::RequestStopSystemTracing( | 42 std::string FakeDebugDaemonClient::GetTracingAgentName() { |
44 scoped_refptr<base::TaskRunner> task_runner, | 43 return kCrOSTracingAgentName; |
45 const StopSystemTracingCallback& callback) { | 44 } |
46 std::string no_data; | 45 |
47 callback.Run(base::RefCountedString::TakeString(&no_data)); | 46 std::string FakeDebugDaemonClient::GetTraceEventLabel() { |
| 47 return kSystemTraceLabel; |
| 48 } |
| 49 |
| 50 bool FakeDebugDaemonClient::StartAgentTracing( |
| 51 const base::trace_event::TraceConfig& trace_config) { |
48 return true; | 52 return true; |
49 } | 53 } |
50 | 54 |
| 55 void FakeDebugDaemonClient::StopAgentTracing( |
| 56 const StopAgentTracingCallback& callback) { |
| 57 std::string no_data; |
| 58 callback.Run(GetTracingAgentName(), GetTraceEventLabel(), |
| 59 base::RefCountedString::TakeString(&no_data)); |
| 60 } |
| 61 |
| 62 void FakeDebugDaemonClient::SetStopAgentTracingTaskRunner( |
| 63 scoped_refptr<base::TaskRunner> task_runner) {} |
| 64 |
51 void FakeDebugDaemonClient::GetRoutes(bool numeric, | 65 void FakeDebugDaemonClient::GetRoutes(bool numeric, |
52 bool ipv6, | 66 bool ipv6, |
53 const GetRoutesCallback& callback) { | 67 const GetRoutesCallback& callback) { |
54 std::vector<std::string> empty; | 68 std::vector<std::string> empty; |
55 base::ThreadTaskRunnerHandle::Get()->PostTask( | 69 base::ThreadTaskRunnerHandle::Get()->PostTask( |
56 FROM_HERE, base::Bind(callback, false, empty)); | 70 FROM_HERE, base::Bind(callback, false, empty)); |
57 } | 71 } |
58 | 72 |
59 void FakeDebugDaemonClient::GetNetworkStatus( | 73 void FakeDebugDaemonClient::GetNetworkStatus( |
60 const GetNetworkStatusCallback& callback) { | 74 const GetNetworkStatusCallback& callback) { |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 if (!is_available) | 189 if (!is_available) |
176 return; | 190 return; |
177 | 191 |
178 std::vector<WaitForServiceToBeAvailableCallback> callbacks; | 192 std::vector<WaitForServiceToBeAvailableCallback> callbacks; |
179 callbacks.swap(pending_wait_for_service_to_be_available_callbacks_); | 193 callbacks.swap(pending_wait_for_service_to_be_available_callbacks_); |
180 for (size_t i = 0; i < callbacks.size(); ++i) | 194 for (size_t i = 0; i < callbacks.size(); ++i) |
181 callbacks[i].Run(is_available); | 195 callbacks[i].Run(is_available); |
182 } | 196 } |
183 | 197 |
184 } // namespace chromeos | 198 } // namespace chromeos |
OLD | NEW |