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

Unified Diff: components/policy/core/common/schema_internal.h

Issue 205923004: Add regex support in policy schema (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@json-schema-regex
Patch Set: Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/policy/core/common/schema.cc ('k') | components/policy/core/common/schema_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/policy/core/common/schema_internal.h
diff --git a/components/policy/core/common/schema_internal.h b/components/policy/core/common/schema_internal.h
index 86e6a2b75b20f16e6d2e98c3840a5df9ad353c26..586b3c3947cbe784d95ce5b770c6adc8d1df5dce 100644
--- a/components/policy/core/common/schema_internal.h
+++ b/components/policy/core/common/schema_internal.h
@@ -63,6 +63,13 @@ struct POLICY_EXPORT PropertiesNode {
// properties can be looked up by binary searching in the range.
int end;
+ // An offset into SchemaData::property_nodes that indexes the PropertyNode
+ // right beyond the last known pattern property.
+ //
+ // [end, pattern_end) is the range that covers all pattern properties
+ // defined. It's not required to be sorted.
+ int pattern_end;
+
// If this map policy supports keys with any value (besides the well-known
// values described in the range [begin, end)) then |additional| is an offset
// into SchemaData::schema_nodes that indexes the SchemaNode describing the
@@ -92,6 +99,14 @@ union POLICY_EXPORT RestrictionNode {
int max_value;
int min_value;
} ranged_restriction;
+
+ // For string type only, requires |pattern_index| and |pattern_index_backup|
+ // to be exactly the same. And it's an offset into SchemaData::string_enums
+ // which contains the regular expression that the target string must follow.
+ struct StringPatternRestriction {
+ int pattern_index;
+ int pattern_index_backup;
+ } string_pattern_restriction;
};
« no previous file with comments | « components/policy/core/common/schema.cc ('k') | components/policy/core/common/schema_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698