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

Unified Diff: extensions/common/extension_api.h

Issue 2271813003: [Extensions] Parse schema string directly into a v8 object (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dc_prefix_schema_in_generation
Patch Set: Rebase 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 | « no previous file | 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 113f41a08c079bfe27745c3dce266fbafa831b3b..0a8aef71d794ca738a8ea4f7456112e8f250f7a8 100644
--- a/extensions/common/extension_api.h
+++ b/extensions/common/extension_api.h
@@ -104,8 +104,13 @@ class ExtensionAPI {
// Returns true if |name| is available to WebUI contexts on |url|.
bool IsAvailableToWebUI(const std::string& name, const GURL& url);
+ // Gets the StringPiece for the schema specified by |api_name|.
+ base::StringPiece GetSchemaStringPiece(const std::string& api_name);
+
// Gets the schema for the extension API with namespace |full_name|.
// Ownership remains with this object.
+ // TODO(devlin): Now that we use GetSchemaStringPiece() in the renderer, we
+ // may not really need this anymore.
const base::DictionaryValue* GetSchema(const std::string& full_name);
// Splits a full name from the extension API into its API and child name
@@ -144,6 +149,9 @@ class ExtensionAPI {
std::map<std::string, std::unique_ptr<const base::DictionaryValue>>;
SchemaMap schemas_;
+ using StringPieceMap = std::map<std::string, base::StringPiece>;
+ StringPieceMap schema_strings_;
+
// FeatureProviders used for resolving dependencies.
typedef std::map<std::string, const FeatureProvider*> FeatureProviderMap;
FeatureProviderMap dependency_providers_;
« no previous file with comments | « no previous file | extensions/common/extension_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698