OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/common/features/simple_feature.h" | 5 #include "extensions/common/features/simple_feature.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 min_manifest_version_(0), | 286 min_manifest_version_(0), |
287 max_manifest_version_(0), | 287 max_manifest_version_(0), |
288 component_extensions_auto_granted_(true) {} | 288 component_extensions_auto_granted_(true) {} |
289 | 289 |
290 SimpleFeature::~SimpleFeature() {} | 290 SimpleFeature::~SimpleFeature() {} |
291 | 291 |
292 bool SimpleFeature::HasDependencies() const { | 292 bool SimpleFeature::HasDependencies() const { |
293 return !dependencies_.empty(); | 293 return !dependencies_.empty(); |
294 } | 294 } |
295 | 295 |
296 void SimpleFeature::AddFilter(scoped_ptr<SimpleFeatureFilter> filter) { | 296 void SimpleFeature::AddFilter(std::unique_ptr<SimpleFeatureFilter> filter) { |
297 filters_.push_back(std::move(filter)); | 297 filters_.push_back(std::move(filter)); |
298 } | 298 } |
299 | 299 |
300 std::string SimpleFeature::Parse(const base::DictionaryValue* dictionary) { | 300 std::string SimpleFeature::Parse(const base::DictionaryValue* dictionary) { |
301 static base::LazyInstance<SimpleFeature::Mappings> mappings = | 301 static base::LazyInstance<SimpleFeature::Mappings> mappings = |
302 LAZY_INSTANCE_INITIALIZER; | 302 LAZY_INSTANCE_INITIALIZER; |
303 | 303 |
304 no_parent_ = false; | 304 no_parent_ = false; |
305 for (base::DictionaryValue::Iterator it(*dictionary); | 305 for (base::DictionaryValue::Iterator it(*dictionary); |
306 !it.IsAtEnd(); | 306 !it.IsAtEnd(); |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 bool SimpleFeature::IsValidExtensionId(const std::string& extension_id) { | 629 bool SimpleFeature::IsValidExtensionId(const std::string& extension_id) { |
630 // Belt-and-suspenders philosophy here. We should be pretty confident by this | 630 // Belt-and-suspenders philosophy here. We should be pretty confident by this |
631 // point that we've validated the extension ID format, but in case something | 631 // point that we've validated the extension ID format, but in case something |
632 // slips through, we avoid a class of attack where creative ID manipulation | 632 // slips through, we avoid a class of attack where creative ID manipulation |
633 // leads to hash collisions. | 633 // leads to hash collisions. |
634 // 128 bits / 4 = 32 mpdecimal characters | 634 // 128 bits / 4 = 32 mpdecimal characters |
635 return (extension_id.length() == 32); | 635 return (extension_id.length() == 32); |
636 } | 636 } |
637 | 637 |
638 } // namespace extensions | 638 } // namespace extensions |
OLD | NEW |