| 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 void FakeDebugDaemonClient::WaitForServiceToBeAvailable( | 192 void FakeDebugDaemonClient::WaitForServiceToBeAvailable( |
| 193 const WaitForServiceToBeAvailableCallback& callback) { | 193 const WaitForServiceToBeAvailableCallback& callback) { |
| 194 if (service_is_available_) { | 194 if (service_is_available_) { |
| 195 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, | 195 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, |
| 196 base::Bind(callback, true)); | 196 base::Bind(callback, true)); |
| 197 } else { | 197 } else { |
| 198 pending_wait_for_service_to_be_available_callbacks_.push_back(callback); | 198 pending_wait_for_service_to_be_available_callbacks_.push_back(callback); |
| 199 } | 199 } |
| 200 } | 200 } |
| 201 | 201 |
| 202 void FakeDebugDaemonClient::SetOomScoreAdj( |
| 203 const std::map<int, int>& scores, |
| 204 const SetOomScoreAdjCallback& callback) { |
| 205 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 206 FROM_HERE, base::Bind(callback, false, "")); |
| 207 } |
| 208 |
| 202 void FakeDebugDaemonClient::SetDebuggingFeaturesStatus(int featues_mask) { | 209 void FakeDebugDaemonClient::SetDebuggingFeaturesStatus(int featues_mask) { |
| 203 featues_mask_ = featues_mask; | 210 featues_mask_ = featues_mask; |
| 204 } | 211 } |
| 205 | 212 |
| 206 void FakeDebugDaemonClient::SetServiceIsAvailable(bool is_available) { | 213 void FakeDebugDaemonClient::SetServiceIsAvailable(bool is_available) { |
| 207 service_is_available_ = is_available; | 214 service_is_available_ = is_available; |
| 208 if (!is_available) | 215 if (!is_available) |
| 209 return; | 216 return; |
| 210 | 217 |
| 211 std::vector<WaitForServiceToBeAvailableCallback> callbacks; | 218 std::vector<WaitForServiceToBeAvailableCallback> callbacks; |
| 212 callbacks.swap(pending_wait_for_service_to_be_available_callbacks_); | 219 callbacks.swap(pending_wait_for_service_to_be_available_callbacks_); |
| 213 for (size_t i = 0; i < callbacks.size(); ++i) | 220 for (size_t i = 0; i < callbacks.size(); ++i) |
| 214 callbacks[i].Run(is_available); | 221 callbacks[i].Run(is_available); |
| 215 } | 222 } |
| 216 | 223 |
| 217 } // namespace chromeos | 224 } // namespace chromeos |
| OLD | NEW |