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

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

Issue 1047943002: Cache --whitelisted-extension-id in SimpleFeature. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Expose SetWhitelistedExtensionId for tests. Created 5 years, 8 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 #ifndef EXTENSIONS_COMMON_FEATURES_SIMPLE_FEATURE_H_ 5 #ifndef EXTENSIONS_COMMON_FEATURES_SIMPLE_FEATURE_H_
6 #define EXTENSIONS_COMMON_FEATURES_SIMPLE_FEATURE_H_ 6 #define EXTENSIONS_COMMON_FEATURES_SIMPLE_FEATURE_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 80
81 bool IsInternal() const override; 81 bool IsInternal() const override;
82 82
83 bool IsIdInBlacklist(const std::string& extension_id) const override; 83 bool IsIdInBlacklist(const std::string& extension_id) const override;
84 bool IsIdInWhitelist(const std::string& extension_id) const override; 84 bool IsIdInWhitelist(const std::string& extension_id) const override;
85 85
86 static bool IsIdInArray(const std::string& extension_id, 86 static bool IsIdInArray(const std::string& extension_id,
87 const char* const array[], 87 const char* const array[],
88 size_t array_length); 88 size_t array_length);
89 89
90 // Used by tests to override the cached --whitelisted-extension-id.
91 static void SetWhitelistedExtensionId(const std::string& id);
not at google - send to devlin 2015/04/08 17:59:22 I prefer to only provide RAII versions of these se
jackhou1 2015/04/09 07:23:28 Done.
92
90 protected: 93 protected:
91 // Similar to Manifest::Location, these are the classes of locations 94 // Similar to Manifest::Location, these are the classes of locations
92 // supported in feature files. Production code should never directly access 95 // supported in feature files. Production code should never directly access
93 // these. 96 // these.
94 enum Location { 97 enum Location {
95 UNSPECIFIED_LOCATION, 98 UNSPECIFIED_LOCATION,
96 COMPONENT_LOCATION, 99 COMPONENT_LOCATION,
97 EXTERNAL_COMPONENT_LOCATION, 100 EXTERNAL_COMPONENT_LOCATION,
98 POLICY_LOCATION, 101 POLICY_LOCATION,
99 }; 102 };
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 std::string command_line_switch_; 195 std::string command_line_switch_;
193 196
194 ScopedVector<SimpleFeatureFilter> filters_;; 197 ScopedVector<SimpleFeatureFilter> filters_;;
195 198
196 DISALLOW_COPY_AND_ASSIGN(SimpleFeature); 199 DISALLOW_COPY_AND_ASSIGN(SimpleFeature);
197 }; 200 };
198 201
199 } // namespace extensions 202 } // namespace extensions
200 203
201 #endif // EXTENSIONS_COMMON_FEATURES_SIMPLE_FEATURE_H_ 204 #endif // EXTENSIONS_COMMON_FEATURES_SIMPLE_FEATURE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698