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

Unified Diff: chrome/common/extensions/api/extension_api.h

Issue 15091002: Lazily load API schemas from resource files and convert all APIs to features (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: convert all APIs to features Created 7 years, 7 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
Index: chrome/common/extensions/api/extension_api.h
diff --git a/chrome/common/extensions/api/extension_api.h b/chrome/common/extensions/api/extension_api.h
index b1aa0cb14a8add24e204e7446f430fd13906d20e..820ac6be4db70df44e89896ff00274361331e8cb 100644
--- a/chrome/common/extensions/api/extension_api.h
+++ b/chrome/common/extensions/api/extension_api.h
@@ -61,8 +61,7 @@ class ExtensionAPI {
ExtensionAPI();
virtual ~ExtensionAPI();
- void RegisterSchema(const std::string& api_name,
- const base::StringPiece& source);
+ void RegisterSchemaResource(const std::string& api_name, int resource_id);
void RegisterDependencyProvider(const std::string& name,
FeatureProvider* provider);
@@ -124,29 +123,9 @@ class ExtensionAPI {
bool IsChildNamePrivileged(const base::DictionaryValue* namespace_node,
const std::string& child_name);
- // NOTE: This IsAPIAllowed() and IsNonFeatureAPIAvailable only work for
- // non-feature-controlled APIs.
- // TODO(aa): Remove these when all APIs are converted to the feature system.
-
- // Checks if API |name| is allowed.
- bool IsAPIAllowed(const std::string& name, const Extension* extension);
-
- // Check if an API is available to |context| given an |extension| and |url|.
- // The extension or URL may not be relevant to all contexts, and may be left
- // NULL/empty.
- bool IsNonFeatureAPIAvailable(const std::string& name,
- Feature::Context context,
- const Extension* extension,
- const GURL& url);
-
- // Checks if an API is *entirely* privileged. This won't include APIs such as
- // "storage" which is entirely unprivileged, nor "extension" which has
- // unprivileged components.
- bool IsPrivilegedAPI(const std::string& name);
-
// 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, base::StringPiece> UnloadedSchemaMap;
+ typedef std::map<std::string, int> UnloadedSchemaMap;
UnloadedSchemaMap unloaded_schemas_;
// Schemas for each namespace.

Powered by Google App Engine
This is Rietveld 408576698