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

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

Issue 12770020: Revert 190836 "Implement API features for the Extension API feat..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 9 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: trunk/src/chrome/common/extensions/api/extension_api.h
===================================================================
--- trunk/src/chrome/common/extensions/api/extension_api.h (revision 190861)
+++ trunk/src/chrome/common/extensions/api/extension_api.h (working copy)
@@ -37,7 +37,7 @@
// WARNING: This class is accessed on multiple threads in the browser process
// (see ExtensionFunctionDispatcher). No state should be modified after
// construction.
-class ExtensionAPI {
+class ExtensionAPI : public FeatureProvider {
public:
// Returns a single shared instance of this class. This is the typical use
// case in Chrome.
@@ -88,6 +88,11 @@
std::set<std::string> GetAllAPINames();
+ // Gets a Feature object describing the API with the specified |full_name|.
+ // This can be either an API namespace (like history, or
+ // experimental.bookmarks), or it can be an individual function or event.
+ virtual Feature* GetFeature(const std::string& full_name) OVERRIDE;
+
// Splits a full name from the extension API into its API and child name
// parts. Some examples:
//
@@ -102,10 +107,6 @@
void InitDefaultConfiguration();
- // Gets a feature from any dependency provider registered with ExtensionAPI.
- // Returns NULL if the feature could not be found.
- Feature* GetFeatureDependency(const std::string& dependency_name);
-
private:
friend struct DefaultSingletonTraits<ExtensionAPI>;
@@ -133,6 +134,24 @@
const Extension* extension,
const GURL& url);
+ // Returns true if the API uses the feature system.
+ bool UsesFeatureSystem(const std::string& full_name);
+
+ // Gets a feature from any dependency provider.
+ Feature* GetFeatureDependency(const std::string& dependency_name);
+
+ // Adds dependent schemas to |out| as determined by the "dependencies"
+ // property.
+ // TODO(aa): Consider making public and adding tests.
+ void ResolveDependencies(std::set<std::string>* out);
+
+ // Adds any APIs listed in "dependencies" found in the schema for |api_name|
+ // but not in |excluding| to |out|.
+ void GetMissingDependencies(
+ const std::string& api_name,
+ const std::set<std::string>& excluding,
+ std::set<std::string>* out);
+
// 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.
« no previous file with comments | « trunk/src/chrome/common/extensions/api/bookmarks.json ('k') | trunk/src/chrome/common/extensions/api/extension_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698