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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 } | 50 } |
51 | 51 |
52 std::string FakeDebugDaemonClient::GetTracingAgentName() { | 52 std::string FakeDebugDaemonClient::GetTracingAgentName() { |
53 return kCrOSTracingAgentName; | 53 return kCrOSTracingAgentName; |
54 } | 54 } |
55 | 55 |
56 std::string FakeDebugDaemonClient::GetTraceEventLabel() { | 56 std::string FakeDebugDaemonClient::GetTraceEventLabel() { |
57 return kCrOSTraceLabel; | 57 return kCrOSTraceLabel; |
58 } | 58 } |
59 | 59 |
60 bool FakeDebugDaemonClient::StartAgentTracing( | 60 void FakeDebugDaemonClient::StartAgentTracing( |
61 const base::trace_event::TraceConfig& trace_config) { | 61 const base::trace_event::TraceConfig& trace_config, |
62 return true; | 62 const StartAgentTracingCallback& callback) { |
| 63 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 64 FROM_HERE, base::Bind(callback, GetTracingAgentName(), true)); |
63 } | 65 } |
64 | 66 |
65 void FakeDebugDaemonClient::StopAgentTracing( | 67 void FakeDebugDaemonClient::StopAgentTracing( |
66 const StopAgentTracingCallback& callback) { | 68 const StopAgentTracingCallback& callback) { |
67 std::string no_data; | 69 std::string no_data; |
68 callback.Run(GetTracingAgentName(), GetTraceEventLabel(), | 70 callback.Run(GetTracingAgentName(), GetTraceEventLabel(), |
69 base::RefCountedString::TakeString(&no_data)); | 71 base::RefCountedString::TakeString(&no_data)); |
70 } | 72 } |
71 | 73 |
72 void FakeDebugDaemonClient::SetStopAgentTracingTaskRunner( | 74 void FakeDebugDaemonClient::SetStopAgentTracingTaskRunner( |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 if (!is_available) | 201 if (!is_available) |
200 return; | 202 return; |
201 | 203 |
202 std::vector<WaitForServiceToBeAvailableCallback> callbacks; | 204 std::vector<WaitForServiceToBeAvailableCallback> callbacks; |
203 callbacks.swap(pending_wait_for_service_to_be_available_callbacks_); | 205 callbacks.swap(pending_wait_for_service_to_be_available_callbacks_); |
204 for (size_t i = 0; i < callbacks.size(); ++i) | 206 for (size_t i = 0; i < callbacks.size(); ++i) |
205 callbacks[i].Run(is_available); | 207 callbacks[i].Run(is_available); |
206 } | 208 } |
207 | 209 |
208 } // namespace chromeos | 210 } // namespace chromeos |
OLD | NEW |