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

Side by Side Diff: extensions/common/extension_api.h

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_EXTENSION_API_H_ 5 #ifndef EXTENSIONS_COMMON_EXTENSION_API_H_
6 #define EXTENSIONS_COMMON_EXTENSION_API_H_ 6 #define EXTENSIONS_COMMON_EXTENSION_API_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 std::string GetAPINameFromFullName(const std::string& full_name, 123 std::string GetAPINameFromFullName(const std::string& full_name,
124 std::string* child_name); 124 std::string* child_name);
125 125
126 // Gets a feature from any dependency provider registered with ExtensionAPI. 126 // Gets a feature from any dependency provider registered with ExtensionAPI.
127 // Returns NULL if the feature could not be found. 127 // Returns NULL if the feature could not be found.
128 Feature* GetFeatureDependency(const std::string& dependency_name); 128 Feature* GetFeatureDependency(const std::string& dependency_name);
129 129
130 private: 130 private:
131 FRIEND_TEST_ALL_PREFIXES(ExtensionAPITest, DefaultConfigurationFeatures); 131 FRIEND_TEST_ALL_PREFIXES(ExtensionAPITest, DefaultConfigurationFeatures);
132 FRIEND_TEST_ALL_PREFIXES(ExtensionAPITest, TypesHaveNamespace); 132 FRIEND_TEST_ALL_PREFIXES(ExtensionAPITest, TypesHaveNamespace);
133 friend struct DefaultSingletonTraits<ExtensionAPI>; 133 friend struct base::DefaultSingletonTraits<ExtensionAPI>;
134 134
135 void InitDefaultConfiguration(); 135 void InitDefaultConfiguration();
136 136
137 bool default_configuration_initialized_; 137 bool default_configuration_initialized_;
138 138
139 // Loads a schema. 139 // Loads a schema.
140 void LoadSchema(const std::string& name, const base::StringPiece& schema); 140 void LoadSchema(const std::string& name, const base::StringPiece& schema);
141 141
142 // Map from each API that hasn't been loaded yet to the schema which defines 142 // Map from each API that hasn't been loaded yet to the schema which defines
143 // it. Note that there may be multiple APIs per schema. 143 // it. Note that there may be multiple APIs per schema.
144 typedef std::map<std::string, int> UnloadedSchemaMap; 144 typedef std::map<std::string, int> UnloadedSchemaMap;
145 UnloadedSchemaMap unloaded_schemas_; 145 UnloadedSchemaMap unloaded_schemas_;
146 146
147 // Schemas for each namespace. 147 // Schemas for each namespace.
148 typedef std::map<std::string, linked_ptr<const base::DictionaryValue> > 148 typedef std::map<std::string, linked_ptr<const base::DictionaryValue> >
149 SchemaMap; 149 SchemaMap;
150 SchemaMap schemas_; 150 SchemaMap schemas_;
151 151
152 // FeatureProviders used for resolving dependencies. 152 // FeatureProviders used for resolving dependencies.
153 typedef std::map<std::string, const FeatureProvider*> FeatureProviderMap; 153 typedef std::map<std::string, const FeatureProvider*> FeatureProviderMap;
154 FeatureProviderMap dependency_providers_; 154 FeatureProviderMap dependency_providers_;
155 155
156 DISALLOW_COPY_AND_ASSIGN(ExtensionAPI); 156 DISALLOW_COPY_AND_ASSIGN(ExtensionAPI);
157 }; 157 };
158 158
159 } // namespace extensions 159 } // namespace extensions
160 160
161 #endif // EXTENSIONS_COMMON_EXTENSION_API_H_ 161 #endif // EXTENSIONS_COMMON_EXTENSION_API_H_
OLDNEW
« no previous file with comments | « extensions/browser/warning_service_factory.cc ('k') | extensions/shell/browser/api/vpn_provider/vpn_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698