| 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 bool FakeDebugDaemonClient::StartAgentTracing( |
| 47 const base::trace_event::TraceConfig& trace_config) { |
| 48 return true; | 48 return true; |
| 49 } | 49 } |
| 50 | 50 |
| 51 void FakeDebugDaemonClient::StopAgentTracing( |
| 52 const StopAgentTracingCallback& callback) { |
| 53 std::string no_data; |
| 54 callback.Run(GetTracingAgentName(), |
| 55 base::RefCountedString::TakeString(&no_data)); |
| 56 } |
| 57 |
| 58 void FakeDebugDaemonClient::SetStopAgentTracingTaskRunner( |
| 59 scoped_refptr<base::TaskRunner> task_runner) {} |
| 60 |
| 51 void FakeDebugDaemonClient::GetRoutes(bool numeric, | 61 void FakeDebugDaemonClient::GetRoutes(bool numeric, |
| 52 bool ipv6, | 62 bool ipv6, |
| 53 const GetRoutesCallback& callback) { | 63 const GetRoutesCallback& callback) { |
| 54 std::vector<std::string> empty; | 64 std::vector<std::string> empty; |
| 55 base::ThreadTaskRunnerHandle::Get()->PostTask( | 65 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 56 FROM_HERE, base::Bind(callback, false, empty)); | 66 FROM_HERE, base::Bind(callback, false, empty)); |
| 57 } | 67 } |
| 58 | 68 |
| 59 void FakeDebugDaemonClient::GetNetworkStatus( | 69 void FakeDebugDaemonClient::GetNetworkStatus( |
| 60 const GetNetworkStatusCallback& callback) { | 70 const GetNetworkStatusCallback& callback) { |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 if (!is_available) | 185 if (!is_available) |
| 176 return; | 186 return; |
| 177 | 187 |
| 178 std::vector<WaitForServiceToBeAvailableCallback> callbacks; | 188 std::vector<WaitForServiceToBeAvailableCallback> callbacks; |
| 179 callbacks.swap(pending_wait_for_service_to_be_available_callbacks_); | 189 callbacks.swap(pending_wait_for_service_to_be_available_callbacks_); |
| 180 for (size_t i = 0; i < callbacks.size(); ++i) | 190 for (size_t i = 0; i < callbacks.size(); ++i) |
| 181 callbacks[i].Run(is_available); | 191 callbacks[i].Run(is_available); |
| 182 } | 192 } |
| 183 | 193 |
| 184 } // namespace chromeos | 194 } // namespace chromeos |
| OLD | NEW |