OLD | NEW |
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 #include "components/policy/core/common/schema.h" | 5 #include "components/policy/core/common/schema.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <climits> | 8 #include <climits> |
9 #include <map> | 9 #include <map> |
10 #include <utility> | 10 #include <utility> |
11 | 11 |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/stl_util.h" | 15 #include "base/stl_util.h" |
16 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
17 #include "components/json_schema/json_schema_constants.h" | 17 #include "components/json_schema/json_schema_constants.h" |
18 #include "components/json_schema/json_schema_validator.h" | 18 #include "components/json_schema/json_schema_validator.h" |
19 #include "components/policy/core/common/schema_internal.h" | 19 #include "components/policy/core/common/schema_internal.h" |
20 #include "third_party/re2/re2/re2.h" | 20 #include "third_party/re2/src/re2/re2.h" |
21 | 21 |
22 namespace schema = json_schema_constants; | 22 namespace schema = json_schema_constants; |
23 | 23 |
24 namespace policy { | 24 namespace policy { |
25 | 25 |
26 using internal::PropertiesNode; | 26 using internal::PropertiesNode; |
27 using internal::PropertyNode; | 27 using internal::PropertyNode; |
28 using internal::RestrictionNode; | 28 using internal::RestrictionNode; |
29 using internal::SchemaData; | 29 using internal::SchemaData; |
30 using internal::SchemaNode; | 30 using internal::SchemaNode; |
(...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1099 return false; | 1099 return false; |
1100 } else { | 1100 } else { |
1101 int index = rnode->string_pattern_restriction.pattern_index; | 1101 int index = rnode->string_pattern_restriction.pattern_index; |
1102 DCHECK(index == rnode->string_pattern_restriction.pattern_index_backup); | 1102 DCHECK(index == rnode->string_pattern_restriction.pattern_index_backup); |
1103 re2::RE2* regex = storage_->CompileRegex(*storage_->string_enums(index)); | 1103 re2::RE2* regex = storage_->CompileRegex(*storage_->string_enums(index)); |
1104 return re2::RE2::PartialMatch(str, *regex); | 1104 return re2::RE2::PartialMatch(str, *regex); |
1105 } | 1105 } |
1106 } | 1106 } |
1107 | 1107 |
1108 } // namespace policy | 1108 } // namespace policy |
OLD | NEW |