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

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: Rebasing... 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
« no previous file with comments | « remoting/host/host_signaling_manager.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 policy::POLICY_SCOPE_MACHINE)); 299 policy::POLICY_SCOPE_MACHINE));
299 #else 300 #else
300 #error OS that is not yet supported by PolicyWatcher code. 301 #error OS that is not yet supported by PolicyWatcher code.
301 #endif 302 #endif
302 303
303 return PolicyWatcher::CreateFromPolicyLoader(policy_loader.Pass()); 304 return PolicyWatcher::CreateFromPolicyLoader(policy_loader.Pass());
304 #endif // !(OS_CHROMEOS) 305 #endif // !(OS_CHROMEOS)
305 } 306 }
306 307
307 } // namespace remoting 308 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/host_signaling_manager.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698