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

Unified Diff: extensions/renderer/bindings/argument_spec.h

Issue 2947223003: [Extensions Bindings] Consider argument type more in signature parsing (Closed)
Patch Set: rebase Created 3 years, 6 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: extensions/renderer/bindings/argument_spec.h
diff --git a/extensions/renderer/bindings/argument_spec.h b/extensions/renderer/bindings/argument_spec.h
index 4425568da1ad2d0024914a54b1ef0fc9ea00fdf9..3f332563532f81461808143bb5cdad30802cef97 100644
--- a/extensions/renderer/bindings/argument_spec.h
+++ b/extensions/renderer/bindings/argument_spec.h
@@ -50,6 +50,12 @@ class ArgumentSpec {
explicit ArgumentSpec(ArgumentType type);
~ArgumentSpec();
+ // Returns true if the given |value| is of the correct type to match this
+ // spec. If it is not, populates |error|.
+ bool IsCorrectType(v8::Local<v8::Value> value,
+ const APITypeReferenceMap& refs,
+ std::string* error) const;
+
// Returns true if the passed |value| matches this specification. If
// |out_value| is non-null, converts the value to a base::Value and populates
// |out_value|. Otherwise, no conversion is performed.
@@ -93,9 +99,6 @@ class ArgumentSpec {
// Initializes this object according to |type_string| and |dict|.
void InitializeType(const base::DictionaryValue* dict);
- // Returns true if this argument refers to a fundamental type.
- bool IsFundamentalType() const;
-
// Conversion functions. These should only be used if the spec is of the given
// type (otherwise, they will DCHECK).
bool ParseArgumentToFundamental(v8::Local<v8::Context> context,
« no previous file with comments | « extensions/renderer/bindings/api_signature_unittest.cc ('k') | extensions/renderer/bindings/argument_spec.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698