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

Side by Side Diff: extensions/common/features/simple_feature.cc

Issue 1152183002: Subsituting pattern ScopedVector push_back.(ptr.release()) with push_back(ptr.Pass()) in extensions… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « extensions/common/features/complex_feature_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <vector> 9 #include <vector>
10 10
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 max_manifest_version_(0), 290 max_manifest_version_(0),
291 component_extensions_auto_granted_(true) {} 291 component_extensions_auto_granted_(true) {}
292 292
293 SimpleFeature::~SimpleFeature() {} 293 SimpleFeature::~SimpleFeature() {}
294 294
295 bool SimpleFeature::HasDependencies() const { 295 bool SimpleFeature::HasDependencies() const {
296 return !dependencies_.empty(); 296 return !dependencies_.empty();
297 } 297 }
298 298
299 void SimpleFeature::AddFilter(scoped_ptr<SimpleFeatureFilter> filter) { 299 void SimpleFeature::AddFilter(scoped_ptr<SimpleFeatureFilter> filter) {
300 filters_.push_back(filter.release()); 300 filters_.push_back(filter.Pass());
301 } 301 }
302 302
303 std::string SimpleFeature::Parse(const base::DictionaryValue* dictionary) { 303 std::string SimpleFeature::Parse(const base::DictionaryValue* dictionary) {
304 static base::LazyInstance<SimpleFeature::Mappings> mappings = 304 static base::LazyInstance<SimpleFeature::Mappings> mappings =
305 LAZY_INSTANCE_INITIALIZER; 305 LAZY_INSTANCE_INITIALIZER;
306 306
307 no_parent_ = false; 307 no_parent_ = false;
308 for (base::DictionaryValue::Iterator it(*dictionary); 308 for (base::DictionaryValue::Iterator it(*dictionary);
309 !it.IsAtEnd(); 309 !it.IsAtEnd();
310 it.Advance()) { 310 it.Advance()) {
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 bool SimpleFeature::IsValidExtensionId(const std::string& extension_id) { 632 bool SimpleFeature::IsValidExtensionId(const std::string& extension_id) {
633 // Belt-and-suspenders philosophy here. We should be pretty confident by this 633 // Belt-and-suspenders philosophy here. We should be pretty confident by this
634 // point that we've validated the extension ID format, but in case something 634 // point that we've validated the extension ID format, but in case something
635 // slips through, we avoid a class of attack where creative ID manipulation 635 // slips through, we avoid a class of attack where creative ID manipulation
636 // leads to hash collisions. 636 // leads to hash collisions.
637 // 128 bits / 4 = 32 mpdecimal characters 637 // 128 bits / 4 = 32 mpdecimal characters
638 return (extension_id.length() == 32); 638 return (extension_id.length() == 32);
639 } 639 }
640 640
641 } // namespace extensions 641 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/common/features/complex_feature_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698