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

Side by Side Diff: components/policy/core/common/schema.h

Issue 24367003: Refactored users of PolicySchema to use the new policy::Schema class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 COMPONENTS_POLICY_CORE_COMMON_SCHEMA_H_ 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_SCHEMA_H_
6 #define COMPONENTS_POLICY_CORE_COMMON_SCHEMA_H_ 6 #define COMPONENTS_POLICY_CORE_COMMON_SCHEMA_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 12 matching lines...) Expand all
23 23
24 } // namespace internal 24 } // namespace internal
25 25
26 // Describes the expected type of one policy. Also recursively describes the 26 // Describes the expected type of one policy. Also recursively describes the
27 // types of inner elements, for structured types. 27 // types of inner elements, for structured types.
28 // Objects of this class refer to external, immutable data and are cheap to 28 // Objects of this class refer to external, immutable data and are cheap to
29 // copy. 29 // copy.
30 // Use the SchemaOwner class to parse a schema and get Schema objects. 30 // Use the SchemaOwner class to parse a schema and get Schema objects.
31 class POLICY_EXPORT Schema { 31 class POLICY_EXPORT Schema {
32 public: 32 public:
33 // Builds an empty, invalid schema.
34 Schema();
35
36 // Builds a schema pointing to the inner structure of |schema|. If |schema|
37 // is NULL then this Schema instance will be invalid.
38 // Does not take ownership of |schema|.
33 explicit Schema(const internal::SchemaNode* schema); 39 explicit Schema(const internal::SchemaNode* schema);
40
34 Schema(const Schema& schema); 41 Schema(const Schema& schema);
35 42
36 Schema& operator=(const Schema& schema); 43 Schema& operator=(const Schema& schema);
37 44
38 // Returns true if this Schema is valid. Schemas returned by the methods below 45 // Returns true if this Schema is valid. Schemas returned by the methods below
39 // may be invalid, and in those cases the other methods must not be used. 46 // may be invalid, and in those cases the other methods must not be used.
40 bool valid() const { return schema_ != NULL; } 47 bool valid() const { return schema_ != NULL; }
41 48
42 base::Value::Type type() const; 49 base::Value::Type type() const;
43 50
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 std::vector<internal::PropertyNode*> property_nodes_; 148 std::vector<internal::PropertyNode*> property_nodes_;
142 ScopedVector<internal::PropertiesNode> properties_nodes_; 149 ScopedVector<internal::PropertiesNode> properties_nodes_;
143 ScopedVector<std::string> keys_; 150 ScopedVector<std::string> keys_;
144 151
145 DISALLOW_COPY_AND_ASSIGN(SchemaOwner); 152 DISALLOW_COPY_AND_ASSIGN(SchemaOwner);
146 }; 153 };
147 154
148 } // namespace policy 155 } // namespace policy
149 156
150 #endif // COMPONENTS_POLICY_CORE_COMMON_SCHEMA_H_ 157 #endif // COMPONENTS_POLICY_CORE_COMMON_SCHEMA_H_
OLDNEW
« no previous file with comments | « components/policy/core/common/policy_schema_unittest.cc ('k') | components/policy/core/common/schema.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698