Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/settings/device_settings_test_helper.h" | 5 #include "chrome/browser/chromeos/settings/device_settings_test_helper.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/threading/sequenced_worker_pool.h" | 9 #include "base/threading/sequenced_worker_pool.h" |
| 10 #include "chrome/browser/chromeos/settings/device_settings_service.h" | 10 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 56 callbacks.swap(device_policy_.retrieve_callbacks_); | 56 callbacks.swap(device_policy_.retrieve_callbacks_); |
| 57 for (std::vector<RetrievePolicyCallback>::iterator cb(callbacks.begin()); | 57 for (std::vector<RetrievePolicyCallback>::iterator cb(callbacks.begin()); |
| 58 cb != callbacks.end(); ++cb) { | 58 cb != callbacks.end(); ++cb) { |
| 59 cb->Run(device_policy_.policy_blob_); | 59 cb->Run(device_policy_.policy_blob_); |
| 60 } | 60 } |
| 61 | 61 |
| 62 std::map<std::string, PolicyState>::iterator device_local_account_state; | 62 std::map<std::string, PolicyState>::iterator device_local_account_state; |
| 63 for (device_local_account_state = device_local_account_policy_.begin(); | 63 for (device_local_account_state = device_local_account_policy_.begin(); |
| 64 device_local_account_state != device_local_account_policy_.end(); | 64 device_local_account_state != device_local_account_policy_.end(); |
| 65 ++device_local_account_state) { | 65 ++device_local_account_state) { |
| 66 std::vector<RetrievePolicyCallback> callbacks; | |
|
Joao da Silva
2013/10/17 14:57:54
Another nice catch :-)
Another option here: callb
bartfab (slow)
2013/10/18 12:58:39
I prefer creating a new object as it conveys best
| |
| 66 callbacks.swap(device_local_account_state->second.retrieve_callbacks_); | 67 callbacks.swap(device_local_account_state->second.retrieve_callbacks_); |
| 67 for (std::vector<RetrievePolicyCallback>::iterator cb(callbacks.begin()); | 68 for (std::vector<RetrievePolicyCallback>::iterator cb(callbacks.begin()); |
| 68 cb != callbacks.end(); ++cb) { | 69 cb != callbacks.end(); ++cb) { |
| 69 cb->Run(device_local_account_state->second.policy_blob_); | 70 cb->Run(device_local_account_state->second.policy_blob_); |
| 70 } | 71 } |
| 71 } | 72 } |
| 72 } | 73 } |
| 73 | 74 |
| 74 void DeviceSettingsTestHelper::Flush() { | 75 void DeviceSettingsTestHelper::Flush() { |
| 75 do { | 76 do { |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 229 void DeviceSettingsTestBase::FlushDeviceSettings() { | 230 void DeviceSettingsTestBase::FlushDeviceSettings() { |
| 230 device_settings_test_helper_.Flush(); | 231 device_settings_test_helper_.Flush(); |
| 231 } | 232 } |
| 232 | 233 |
| 233 void DeviceSettingsTestBase::ReloadDeviceSettings() { | 234 void DeviceSettingsTestBase::ReloadDeviceSettings() { |
| 234 device_settings_service_.OwnerKeySet(true); | 235 device_settings_service_.OwnerKeySet(true); |
| 235 FlushDeviceSettings(); | 236 FlushDeviceSettings(); |
| 236 } | 237 } |
| 237 | 238 |
| 238 } // namespace chromeos | 239 } // namespace chromeos |
| OLD | NEW |