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

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

Issue 2199683002: Reland of Further reduction of feature_compiler.py generated code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@test-with-leiz
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
« no previous file with comments | « no previous file | extensions/common/features/base_feature_provider.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 #ifndef EXTENSIONS_COMMON_FEATURES_BASE_FEATURE_PROVIDER_H_ 5 #ifndef EXTENSIONS_COMMON_FEATURES_BASE_FEATURE_PROVIDER_H_
6 #define EXTENSIONS_COMMON_FEATURES_BASE_FEATURE_PROVIDER_H_ 6 #define EXTENSIONS_COMMON_FEATURES_BASE_FEATURE_PROVIDER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 23 matching lines...) Expand all
34 Feature* GetParent(Feature* feature) const override; 34 Feature* GetParent(Feature* feature) const override;
35 std::vector<Feature*> GetChildren(const Feature& parent) const override; 35 std::vector<Feature*> GetChildren(const Feature& parent) const override;
36 36
37 const FeatureMap& GetAllFeatures() const override; 37 const FeatureMap& GetAllFeatures() const override;
38 38
39 protected: 39 protected:
40 BaseFeatureProvider(); 40 BaseFeatureProvider();
41 41
42 void AddFeature(base::StringPiece name, std::unique_ptr<Feature> feature); 42 void AddFeature(base::StringPiece name, std::unique_ptr<Feature> feature);
43 43
44 // Takes ownership. Used in preference to unique_ptr variant to reduce size
45 // of generated code.
46 void AddFeature(base::StringPiece name, Feature* feature);
47
44 private: 48 private:
45 std::map<std::string, std::unique_ptr<Feature>> features_; 49 std::map<std::string, std::unique_ptr<Feature>> features_;
46 50
47 DISALLOW_COPY_AND_ASSIGN(BaseFeatureProvider); 51 DISALLOW_COPY_AND_ASSIGN(BaseFeatureProvider);
48 }; 52 };
49 53
50 } // namespace extensions 54 } // namespace extensions
51 55
52 #endif // EXTENSIONS_COMMON_FEATURES_BASE_FEATURE_PROVIDER_H_ 56 #endif // EXTENSIONS_COMMON_FEATURES_BASE_FEATURE_PROVIDER_H_
OLDNEW
« no previous file with comments | « no previous file | extensions/common/features/base_feature_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698