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

Side by Side Diff: chrome/browser/policy/policy_service.h

Issue 22493010: policy: load JSON schema into domain descriptor at start time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comments and clean up includes Created 7 years, 3 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 (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 #ifndef CHROME_BROWSER_POLICY_POLICY_SERVICE_H_ 5 #ifndef CHROME_BROWSER_POLICY_POLICY_SERVICE_H_
6 #define CHROME_BROWSER_POLICY_POLICY_SERVICE_H_ 6 #define CHROME_BROWSER_POLICY_POLICY_SERVICE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 // Registers the |descriptor| of a policy domain, indicated by 89 // Registers the |descriptor| of a policy domain, indicated by
90 // |descriptor->domain()|. This overrides the descriptor previously set, if 90 // |descriptor->domain()|. This overrides the descriptor previously set, if
91 // there was one. 91 // there was one.
92 // This registration signals that there is interest in receiving policy for 92 // This registration signals that there is interest in receiving policy for
93 // the components listed in the descriptor. The policy providers will try to 93 // the components listed in the descriptor. The policy providers will try to
94 // load policy for these components, and validate it against the descriptor. 94 // load policy for these components, and validate it against the descriptor.
95 // Cached data for components that aren't registered anymore may be dropped. 95 // Cached data for components that aren't registered anymore may be dropped.
96 virtual void RegisterPolicyDomain( 96 virtual void RegisterPolicyDomain(
97 scoped_refptr<const PolicyDomainDescriptor> descriptor) = 0; 97 scoped_refptr<const PolicyDomainDescriptor> descriptor) = 0;
98 98
99 // Registers a policy domain without triggering a policy load.
100 virtual void InitialRegisterPolicyDomain(
101 scoped_refptr<const PolicyDomainDescriptor> descriptor) = 0;
102
99 virtual const PolicyMap& GetPolicies(const PolicyNamespace& ns) const = 0; 103 virtual const PolicyMap& GetPolicies(const PolicyNamespace& ns) const = 0;
100 104
101 virtual scoped_refptr<const PolicyDomainDescriptor> GetPolicyDomainDescriptor( 105 virtual scoped_refptr<const PolicyDomainDescriptor> GetPolicyDomainDescriptor(
102 PolicyDomain domain) const = 0; 106 PolicyDomain domain) const = 0;
103 107
104 // The PolicyService loads policy from several sources, and some require 108 // The PolicyService loads policy from several sources, and some require
105 // asynchronous loads. IsInitializationComplete() returns true once all 109 // asynchronous loads. IsInitializationComplete() returns true once all
106 // sources have loaded their policies for the given |domain|. 110 // sources have loaded their policies for the given |domain|.
107 // It is safe to read policy from the PolicyService even if 111 // It is safe to read policy from the PolicyService even if
108 // IsInitializationComplete() is false; there will be an OnPolicyUpdated() 112 // IsInitializationComplete() is false; there will be an OnPolicyUpdated()
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 PolicyService* policy_service_; 157 PolicyService* policy_service_;
154 PolicyNamespace ns_; 158 PolicyNamespace ns_;
155 CallbackMap callback_map_; 159 CallbackMap callback_map_;
156 160
157 DISALLOW_COPY_AND_ASSIGN(PolicyChangeRegistrar); 161 DISALLOW_COPY_AND_ASSIGN(PolicyChangeRegistrar);
158 }; 162 };
159 163
160 } // namespace policy 164 } // namespace policy
161 165
162 #endif // CHROME_BROWSER_POLICY_POLICY_SERVICE_H_ 166 #endif // CHROME_BROWSER_POLICY_POLICY_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698