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

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

Issue 2186893002: Reduce size of generated extension FeatureProviders. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 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 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 <utility>
8
7 #include "base/strings/string_split.h" 9 #include "base/strings/string_split.h"
8 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
9 #include "extensions/common/features/feature.h" 11 #include "extensions/common/features/feature.h"
10 12
11 namespace extensions { 13 namespace extensions {
12 14
13 BaseFeatureProvider::BaseFeatureProvider() {} 15 BaseFeatureProvider::BaseFeatureProvider() {}
14 BaseFeatureProvider::~BaseFeatureProvider() {} 16 BaseFeatureProvider::~BaseFeatureProvider() {}
15 17
16 const FeatureMap& BaseFeatureProvider::GetAllFeatures() const { 18 const FeatureMap& BaseFeatureProvider::GetAllFeatures() const {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 54
53 std::vector<Feature*> result; 55 std::vector<Feature*> result;
54 result.reserve(std::distance(first_child, after_children)); 56 result.reserve(std::distance(first_child, after_children));
55 for (FeatureMap::const_iterator it = first_child; it != after_children; 57 for (FeatureMap::const_iterator it = first_child; it != after_children;
56 ++it) { 58 ++it) {
57 result.push_back(it->second.get()); 59 result.push_back(it->second.get());
58 } 60 }
59 return result; 61 return result;
60 } 62 }
61 63
64 void BaseFeatureProvider::AddFeature(base::StringPiece name,
65 std::unique_ptr<Feature> feature) {
66 features_[name.as_string()] = std::move(feature);
67 }
68
62 } // namespace extensions 69 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/common/features/base_feature_provider.h ('k') | extensions/common/features/feature.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698