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