Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Side by Side Diff: remoting/host/policy_watcher.cc

Issue 910403002: Suspend (rather than shut down) the host upon policy errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mistyped-policies
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 // Most of this code is copied from: 5 // Most of this code is copied from:
6 // src/chrome/browser/policy/asynchronous_policy_loader.{h,cc} 6 // src/chrome/browser/policy/asynchronous_policy_loader.{h,cc}
7 7
8 #include "remoting/host/policy_watcher.h" 8 #include "remoting/host/policy_watcher.h"
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 // Save the new policies. 138 // Save the new policies.
139 old_policies_.swap(new_policies); 139 old_policies_.swap(new_policies);
140 140
141 // Notify our client of the changed policies. 141 // Notify our client of the changed policies.
142 if (!changed_policies->empty()) { 142 if (!changed_policies->empty()) {
143 policy_updated_callback_.Run(changed_policies.Pass()); 143 policy_updated_callback_.Run(changed_policies.Pass());
144 } 144 }
145 } 145 }
146 146
147 void PolicyWatcher::SignalPolicyError() { 147 void PolicyWatcher::SignalPolicyError() {
148 old_policies_->Clear();
148 policy_error_callback_.Run(); 149 policy_error_callback_.Run();
149 } 150 }
150 151
151 PolicyWatcher::PolicyWatcher( 152 PolicyWatcher::PolicyWatcher(
152 policy::PolicyService* policy_service, 153 policy::PolicyService* policy_service,
153 scoped_ptr<policy::PolicyService> owned_policy_service, 154 scoped_ptr<policy::PolicyService> owned_policy_service,
154 scoped_ptr<policy::ConfigurationPolicyProvider> owned_policy_provider, 155 scoped_ptr<policy::ConfigurationPolicyProvider> owned_policy_provider,
155 scoped_ptr<policy::SchemaRegistry> owned_schema_registry) 156 scoped_ptr<policy::SchemaRegistry> owned_schema_registry)
156 : old_policies_(new base::DictionaryValue()), 157 : old_policies_(new base::DictionaryValue()),
157 default_values_(new base::DictionaryValue()), 158 default_values_(new base::DictionaryValue()),
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 policy::POLICY_SCOPE_MACHINE)); 305 policy::POLICY_SCOPE_MACHINE));
305 #else 306 #else
306 #error OS that is not yet supported by PolicyWatcher code. 307 #error OS that is not yet supported by PolicyWatcher code.
307 #endif 308 #endif
308 309
309 return PolicyWatcher::CreateFromPolicyLoader(policy_loader.Pass()); 310 return PolicyWatcher::CreateFromPolicyLoader(policy_loader.Pass());
310 #endif // !(OS_CHROMEOS) 311 #endif // !(OS_CHROMEOS)
311 } 312 }
312 313
313 } // namespace remoting 314 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698