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

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

Issue 47513018: Make the internal storage of policy::Schemas ref counted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@chrome-policy-schema-4-new-generate
Patch Set: rebase Created 7 years, 1 month 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #ifndef CHROME_BROWSER_POLICY_POLICY_DOMAIN_DESCRIPTOR_H_ 5 #ifndef CHROME_BROWSER_POLICY_POLICY_DOMAIN_DESCRIPTOR_H_
6 #define CHROME_BROWSER_POLICY_POLICY_DOMAIN_DESCRIPTOR_H_ 6 #define CHROME_BROWSER_POLICY_POLICY_DOMAIN_DESCRIPTOR_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 15 matching lines...) Expand all
26 typedef std::map<std::string, Schema> SchemaMap; 26 typedef std::map<std::string, Schema> SchemaMap;
27 27
28 explicit PolicyDomainDescriptor(PolicyDomain domain); 28 explicit PolicyDomainDescriptor(PolicyDomain domain);
29 29
30 PolicyDomain domain() const { return domain_; } 30 PolicyDomain domain() const { return domain_; }
31 const SchemaMap& components() const { return schema_map_; } 31 const SchemaMap& components() const { return schema_map_; }
32 32
33 // Registers the given |component_id| for this domain, and sets its current 33 // Registers the given |component_id| for this domain, and sets its current
34 // |schema|. This registration overrides any previously set schema for this 34 // |schema|. This registration overrides any previously set schema for this
35 // component. 35 // component.
36 void RegisterComponent(const std::string& component_id, 36 void RegisterComponent(const std::string& component_id, Schema schema);
37 scoped_ptr<SchemaOwner> schema);
38 37
39 // Removes all the policies in |bundle| that don't match this descriptor. 38 // Removes all the policies in |bundle| that don't match this descriptor.
40 // Policies of domains other than |domain_| are ignored. 39 // Policies of domains other than |domain_| are ignored.
41 void FilterBundle(PolicyBundle* bundle) const; 40 void FilterBundle(PolicyBundle* bundle) const;
42 41
43 private: 42 private:
44 typedef std::map<std::string, SchemaOwner*> SchemaOwnerMap;
45
46 friend class base::RefCountedThreadSafe<PolicyDomainDescriptor>; 43 friend class base::RefCountedThreadSafe<PolicyDomainDescriptor>;
47 44
48 ~PolicyDomainDescriptor(); 45 ~PolicyDomainDescriptor();
49 46
50 PolicyDomain domain_; 47 PolicyDomain domain_;
51 SchemaOwnerMap schema_owner_map_;
52 SchemaMap schema_map_; 48 SchemaMap schema_map_;
53 49
54 DISALLOW_COPY_AND_ASSIGN(PolicyDomainDescriptor); 50 DISALLOW_COPY_AND_ASSIGN(PolicyDomainDescriptor);
55 }; 51 };
56 52
57 } // namespace policy 53 } // namespace policy
58 54
59 #endif // CHROME_BROWSER_POLICY_POLICY_DOMAIN_DESCRIPTOR_H_ 55 #endif // CHROME_BROWSER_POLICY_POLICY_DOMAIN_DESCRIPTOR_H_
OLDNEW
« no previous file with comments | « chrome/browser/policy/generate_policy_source_unittest.cc ('k') | chrome/browser/policy/policy_domain_descriptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698