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_session_manager_client.h" | 5 #include "chromeos/dbus/fake_session_manager_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
182 FROM_HERE, base::Bind(callback, arc_available_)); | 182 FROM_HERE, base::Bind(callback, arc_available_)); |
183 } | 183 } |
184 | 184 |
185 void FakeSessionManagerClient::SetArcCpuRestriction( | 185 void FakeSessionManagerClient::SetArcCpuRestriction( |
186 login_manager::ContainerCpuRestrictionState restriction_state, | 186 login_manager::ContainerCpuRestrictionState restriction_state, |
187 const ArcCallback& callback) { | 187 const ArcCallback& callback) { |
188 base::ThreadTaskRunnerHandle::Get()->PostTask( | 188 base::ThreadTaskRunnerHandle::Get()->PostTask( |
189 FROM_HERE, base::Bind(callback, arc_available_)); | 189 FROM_HERE, base::Bind(callback, arc_available_)); |
190 } | 190 } |
191 | 191 |
192 void FakeSessionManagerClient::EmitArcBooted() {} | 192 void FakeSessionManagerClient::EmitArcBooted( |
193 const cryptohome::Identification& cryptohome_id, | |
194 const ArcCallback& callback) { | |
195 if (!callback.is_null()) { | |
Luis Héctor Chávez
2017/02/15 19:02:11
use guard clause pattern:
if (callback.is_null())
xzhou
2017/02/16 18:34:50
I am not sure why we check it here. I see RemoveAr
Yusuke Sato
2017/02/16 18:42:57
RemoveArcData's check seems just redundant. I don'
xzhou
2017/02/16 20:17:31
Done.
| |
196 base::ThreadTaskRunnerHandle::Get()->PostTask( | |
197 FROM_HERE, base::Bind(callback, arc_available_)); | |
198 } | |
199 } | |
193 | 200 |
194 void FakeSessionManagerClient::GetArcStartTime( | 201 void FakeSessionManagerClient::GetArcStartTime( |
195 const GetArcStartTimeCallback& callback) { | 202 const GetArcStartTimeCallback& callback) { |
196 base::ThreadTaskRunnerHandle::Get()->PostTask( | 203 base::ThreadTaskRunnerHandle::Get()->PostTask( |
197 FROM_HERE, base::Bind(callback, arc_available_, base::TimeTicks::Now())); | 204 FROM_HERE, base::Bind(callback, arc_available_, base::TimeTicks::Now())); |
198 } | 205 } |
199 | 206 |
200 void FakeSessionManagerClient::RemoveArcData( | 207 void FakeSessionManagerClient::RemoveArcData( |
201 const cryptohome::Identification& cryptohome_id, | 208 const cryptohome::Identification& cryptohome_id, |
202 const ArcCallback& callback) { | 209 const ArcCallback& callback) { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
241 const std::string& policy_blob) { | 248 const std::string& policy_blob) { |
242 device_local_account_policy_[account_id] = policy_blob; | 249 device_local_account_policy_[account_id] = policy_blob; |
243 } | 250 } |
244 | 251 |
245 void FakeSessionManagerClient::OnPropertyChangeComplete(bool success) { | 252 void FakeSessionManagerClient::OnPropertyChangeComplete(bool success) { |
246 for (auto& observer : observers_) | 253 for (auto& observer : observers_) |
247 observer.PropertyChangeComplete(success); | 254 observer.PropertyChangeComplete(success); |
248 } | 255 } |
249 | 256 |
250 } // namespace chromeos | 257 } // namespace chromeos |
OLD | NEW |