| 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> |
| 8 #include <stdint.h> |
| 9 |
| 7 #include <map> | 10 #include <map> |
| 8 #include <string> | 11 #include <string> |
| 9 | 12 |
| 10 #include "base/bind.h" | 13 #include "base/bind.h" |
| 11 #include "base/callback.h" | 14 #include "base/callback.h" |
| 12 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 13 #include "base/location.h" | 16 #include "base/location.h" |
| 14 #include "base/single_thread_task_runner.h" | 17 #include "base/single_thread_task_runner.h" |
| 15 #include "base/thread_task_runner_handle.h" | 18 #include "base/thread_task_runner_handle.h" |
| 16 #include "chromeos/chromeos_switches.h" | 19 #include "chromeos/chromeos_switches.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 const GetNetworkInterfacesCallback& callback) { | 102 const GetNetworkInterfacesCallback& callback) { |
| 100 base::ThreadTaskRunnerHandle::Get()->PostTask( | 103 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 101 FROM_HERE, base::Bind(callback, false, "")); | 104 FROM_HERE, base::Bind(callback, false, "")); |
| 102 } | 105 } |
| 103 | 106 |
| 104 void FakeDebugDaemonClient::GetPerfOutput( | 107 void FakeDebugDaemonClient::GetPerfOutput( |
| 105 uint32_t duration, | 108 uint32_t duration, |
| 106 const std::vector<std::string>& perf_args, | 109 const std::vector<std::string>& perf_args, |
| 107 const GetPerfOutputCallback& callback) { | 110 const GetPerfOutputCallback& callback) { |
| 108 int status = 0; | 111 int status = 0; |
| 109 std::vector<uint8> perf_data; | 112 std::vector<uint8_t> perf_data; |
| 110 std::vector<uint8> perf_stat; | 113 std::vector<uint8_t> perf_stat; |
| 111 base::ThreadTaskRunnerHandle::Get()->PostTask( | 114 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 112 FROM_HERE, base::Bind(callback, status, perf_data, perf_stat)); | 115 FROM_HERE, base::Bind(callback, status, perf_data, perf_stat)); |
| 113 } | 116 } |
| 114 | 117 |
| 115 void FakeDebugDaemonClient::GetScrubbedLogs(const GetLogsCallback& callback) { | 118 void FakeDebugDaemonClient::GetScrubbedLogs(const GetLogsCallback& callback) { |
| 116 std::map<std::string, std::string> sample; | 119 std::map<std::string, std::string> sample; |
| 117 sample["Sample Scrubbed Log"] = "Your email address is xxxxxxxx"; | 120 sample["Sample Scrubbed Log"] = "Your email address is xxxxxxxx"; |
| 118 base::ThreadTaskRunnerHandle::Get()->PostTask( | 121 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 119 FROM_HERE, base::Bind(callback, false, sample)); | 122 FROM_HERE, base::Bind(callback, false, sample)); |
| 120 } | 123 } |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 if (!is_available) | 199 if (!is_available) |
| 197 return; | 200 return; |
| 198 | 201 |
| 199 std::vector<WaitForServiceToBeAvailableCallback> callbacks; | 202 std::vector<WaitForServiceToBeAvailableCallback> callbacks; |
| 200 callbacks.swap(pending_wait_for_service_to_be_available_callbacks_); | 203 callbacks.swap(pending_wait_for_service_to_be_available_callbacks_); |
| 201 for (size_t i = 0; i < callbacks.size(); ++i) | 204 for (size_t i = 0; i < callbacks.size(); ++i) |
| 202 callbacks[i].Run(is_available); | 205 callbacks[i].Run(is_available); |
| 203 } | 206 } |
| 204 | 207 |
| 205 } // namespace chromeos | 208 } // namespace chromeos |
| OLD | NEW |