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

Unified Diff: extensions/common/extension_api.h

Issue 2266673002: [Extensions] Remove mechanism for non-generated schemas (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: testfix 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/chrome_extensions_client.cc ('k') | extensions/common/extension_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/extension_api.h
diff --git a/extensions/common/extension_api.h b/extensions/common/extension_api.h
index e876079b37858897adf6611bcfe679e5744fed8a..2a232b8423fe4a1a265af2842687849b846d4a67 100644
--- a/extensions/common/extension_api.h
+++ b/extensions/common/extension_api.h
@@ -65,14 +65,11 @@ class ExtensionAPI {
ExtensionAPI* original_api_;
};
- // Creates a completely clean instance. Configure using RegisterSchema() and
+ // Creates a completely clean instance. Configure using
// RegisterDependencyProvider before use.
ExtensionAPI();
virtual ~ExtensionAPI();
- // Add a (non-generated) API schema resource.
- void RegisterSchemaResource(const std::string& api_name, int resource_id);
-
// Add a FeatureProvider for APIs. The features are used to specify
// dependencies and constraints on the availability of APIs.
void RegisterDependencyProvider(const std::string& name,
@@ -126,6 +123,9 @@ class ExtensionAPI {
// Returns NULL if the feature could not be found.
Feature* GetFeatureDependency(const std::string& dependency_name);
+ // Adds a fake schema that the ExtensionAPI should know about.
+ void RegisterFakeSchemaForTesting(const std::string& schema);
+
private:
FRIEND_TEST_ALL_PREFIXES(ExtensionAPITest, DefaultConfigurationFeatures);
FRIEND_TEST_ALL_PREFIXES(ExtensionAPITest, TypesHaveNamespace);
@@ -138,10 +138,9 @@ class ExtensionAPI {
// Loads a schema.
void LoadSchema(const std::string& name, const base::StringPiece& schema);
- // Map from each API that hasn't been loaded yet to the schema which defines
- // it. Note that there may be multiple APIs per schema.
- typedef std::map<std::string, int> UnloadedSchemaMap;
- UnloadedSchemaMap unloaded_schemas_;
+ // A set of fake schema resources that we should treat as knowing for testing.
+ // TODO(devlin): This is rather silly.
+ std::set<std::string> fake_schemas_;
Devlin 2016/08/22 18:30:45 I don't love this, but I also don't have a better
lazyboy 2016/08/22 22:51:31 I would put them in TestExtensionAPI (extending fr
Devlin 2016/08/23 00:13:08 Works for me. Still not my favorite, but I think
// Schemas for each namespace.
using SchemaMap =
« no previous file with comments | « chrome/common/extensions/chrome_extensions_client.cc ('k') | extensions/common/extension_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698