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

Unified Diff: extensions/renderer/api_type_reference_map.h

Issue 2716883003: [Extensions Bindings] Store API type methods in the reference map (Closed)
Patch Set: . Created 3 years, 10 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 | « extensions/renderer/api_binding.cc ('k') | extensions/renderer/api_type_reference_map.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/api_type_reference_map.h
diff --git a/extensions/renderer/api_type_reference_map.h b/extensions/renderer/api_type_reference_map.h
index cf572bd167781bb5e1a49c75f4a7eb4c8aad97db..e96099657025babc2b2db603a882ad973449e1d8 100644
--- a/extensions/renderer/api_type_reference_map.h
+++ b/extensions/renderer/api_type_reference_map.h
@@ -13,10 +13,10 @@
#include "base/macros.h"
namespace extensions {
+class APISignature;
class ArgumentSpec;
-// A map from type name -> ArgumentSpec for API type definitions. This is used
-// when an argument is declared to be a reference to a type defined elsewhere.
+// A map storing type specifications and method signatures for API definitions.
class APITypeReferenceMap {
public:
// A callback used to initialize an unknown type, so that these can be
@@ -32,6 +32,17 @@ class APITypeReferenceMap {
// Returns the spec for the given |name|.
const ArgumentSpec* GetSpec(const std::string& name) const;
+ // Adds the |signature| to the map under the given |name|. |name| is expected
+ // to be fully qualified with API, type, and method (e.g.
+ // storage.StorageArea.get).
+ void AddTypeMethodSignature(const std::string& name,
+ std::unique_ptr<APISignature> signature);
+
+ // Returns the signature for the given |name|. |name| is expected
+ // to be fully qualified with API, type, and method (e.g.
+ // storage.StorageArea.get).
+ const APISignature* GetTypeMethodSignature(const std::string& name) const;
+
bool empty() const { return type_refs_.empty(); }
size_t size() const { return type_refs_.size(); }
@@ -40,6 +51,8 @@ class APITypeReferenceMap {
std::map<std::string, std::unique_ptr<ArgumentSpec>> type_refs_;
+ std::map<std::string, std::unique_ptr<APISignature>> type_methods_;
+
DISALLOW_COPY_AND_ASSIGN(APITypeReferenceMap);
};
« no previous file with comments | « extensions/renderer/api_binding.cc ('k') | extensions/renderer/api_type_reference_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698