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

Side by Side Diff: extensions/common/features/base_feature_provider.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 | « no previous file | extensions/common/features/complex_feature_unittest.cc » ('j') | 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/base_feature_provider.h" 5 #include "extensions/common/features/base_feature_provider.h"
6 6
7 #include <stack> 7 #include <stack>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 LOG(ERROR) << iter.key() << ": Feature rules must be dictionaries."; 121 LOG(ERROR) << iter.key() << ": Feature rules must be dictionaries.";
122 continue; 122 continue;
123 } 123 }
124 124
125 scoped_ptr<SimpleFeature> feature((*factory_)()); 125 scoped_ptr<SimpleFeature> feature((*factory_)());
126 if (!ParseFeature(static_cast<const base::DictionaryValue*>(*list_iter), 126 if (!ParseFeature(static_cast<const base::DictionaryValue*>(*list_iter),
127 iter.key(), 127 iter.key(),
128 feature.get())) 128 feature.get()))
129 continue; 129 continue;
130 130
131 features->push_back(feature.release()); 131 features->push_back(feature.Pass());
132 } 132 }
133 133
134 linked_ptr<ComplexFeature> feature(new ComplexFeature(features.Pass())); 134 linked_ptr<ComplexFeature> feature(new ComplexFeature(features.Pass()));
135 feature->set_name(iter.key()); 135 feature->set_name(iter.key());
136 136
137 features_[iter.key()] = feature; 137 features_[iter.key()] = feature;
138 } else { 138 } else {
139 LOG(ERROR) << iter.key() << ": Feature description must be dictionary or" 139 LOG(ERROR) << iter.key() << ": Feature description must be dictionary or"
140 << " list of dictionaries."; 140 << " list of dictionaries.";
141 } 141 }
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 std::vector<Feature*> result; 194 std::vector<Feature*> result;
195 result.reserve(std::distance(first_child, after_children)); 195 result.reserve(std::distance(first_child, after_children));
196 for (FeatureMap::const_iterator it = first_child; it != after_children; 196 for (FeatureMap::const_iterator it = first_child; it != after_children;
197 ++it) { 197 ++it) {
198 result.push_back(it->second.get()); 198 result.push_back(it->second.get());
199 } 199 }
200 return result; 200 return result;
201 } 201 }
202 202
203 } // namespace extensions 203 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | extensions/common/features/complex_feature_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698