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.cc

Issue 506633004: Remove implicit conversions from scoped_refptr to T* in components/policy/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Some more changes Created 6 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 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>
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 // Checks for invalid attributes at the top-level. 968 // Checks for invalid attributes at the top-level.
969 if (dict->HasKey(schema::kAdditionalProperties) || 969 if (dict->HasKey(schema::kAdditionalProperties) ||
970 dict->HasKey(schema::kPatternProperties)) { 970 dict->HasKey(schema::kPatternProperties)) {
971 *error = "\"additionalProperties\" and \"patternProperties\" are not " 971 *error = "\"additionalProperties\" and \"patternProperties\" are not "
972 "supported at the main schema."; 972 "supported at the main schema.";
973 return Schema(); 973 return Schema();
974 } 974 }
975 975
976 scoped_refptr<const InternalStorage> storage = 976 scoped_refptr<const InternalStorage> storage =
977 InternalStorage::ParseSchema(*dict, error); 977 InternalStorage::ParseSchema(*dict, error);
978 if (!storage) 978 if (!storage.get())
979 return Schema(); 979 return Schema();
980 return Schema(storage, storage->root_node()); 980 return Schema(storage, storage->root_node());
981 } 981 }
982 982
983 base::Value::Type Schema::type() const { 983 base::Value::Type Schema::type() const {
984 CHECK(valid()); 984 CHECK(valid());
985 return node_->type; 985 return node_->type;
986 } 986 }
987 987
988 Schema::Iterator Schema::GetPropertiesIterator() const { 988 Schema::Iterator Schema::GetPropertiesIterator() const {
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698