OLD | NEW |
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 <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/linked_ptr.h" | |
15 #include "base/memory/singleton.h" | 14 #include "base/memory/singleton.h" |
16 #include "base/strings/string_piece.h" | 15 #include "base/strings/string_piece.h" |
17 #include "base/values.h" | 16 #include "base/values.h" |
18 #include "extensions/common/features/feature.h" | 17 #include "extensions/common/features/feature.h" |
19 #include "extensions/common/features/feature_provider.h" | 18 #include "extensions/common/features/feature_provider.h" |
20 #include "extensions/common/url_pattern_set.h" | 19 #include "extensions/common/url_pattern_set.h" |
21 | 20 |
22 namespace base { | 21 namespace base { |
23 class DictionaryValue; | 22 class DictionaryValue; |
24 class Value; | 23 class Value; |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 137 |
139 // Loads a schema. | 138 // Loads a schema. |
140 void LoadSchema(const std::string& name, const base::StringPiece& schema); | 139 void LoadSchema(const std::string& name, const base::StringPiece& schema); |
141 | 140 |
142 // Map from each API that hasn't been loaded yet to the schema which defines | 141 // 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. | 142 // it. Note that there may be multiple APIs per schema. |
144 typedef std::map<std::string, int> UnloadedSchemaMap; | 143 typedef std::map<std::string, int> UnloadedSchemaMap; |
145 UnloadedSchemaMap unloaded_schemas_; | 144 UnloadedSchemaMap unloaded_schemas_; |
146 | 145 |
147 // Schemas for each namespace. | 146 // Schemas for each namespace. |
148 typedef std::map<std::string, linked_ptr<const base::DictionaryValue> > | 147 using SchemaMap = |
149 SchemaMap; | 148 std::map<std::string, std::unique_ptr<const base::DictionaryValue>>; |
150 SchemaMap schemas_; | 149 SchemaMap schemas_; |
151 | 150 |
152 // FeatureProviders used for resolving dependencies. | 151 // FeatureProviders used for resolving dependencies. |
153 typedef std::map<std::string, const FeatureProvider*> FeatureProviderMap; | 152 typedef std::map<std::string, const FeatureProvider*> FeatureProviderMap; |
154 FeatureProviderMap dependency_providers_; | 153 FeatureProviderMap dependency_providers_; |
155 | 154 |
156 DISALLOW_COPY_AND_ASSIGN(ExtensionAPI); | 155 DISALLOW_COPY_AND_ASSIGN(ExtensionAPI); |
157 }; | 156 }; |
158 | 157 |
159 } // namespace extensions | 158 } // namespace extensions |
160 | 159 |
161 #endif // EXTENSIONS_COMMON_EXTENSION_API_H_ | 160 #endif // EXTENSIONS_COMMON_EXTENSION_API_H_ |
OLD | NEW |