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

Unified Diff: Source/bindings/core/v8/V8Binding.h

Issue 1047993002: bindings: Add validation for enum Sequence or Array (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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: Source/bindings/core/v8/V8Binding.h
diff --git a/Source/bindings/core/v8/V8Binding.h b/Source/bindings/core/v8/V8Binding.h
index bd91db5a69109c53e1531e03ef5305a37f005f95..dd1acf04c2aa80cec3b403473e936c19390720dd 100644
--- a/Source/bindings/core/v8/V8Binding.h
+++ b/Source/bindings/core/v8/V8Binding.h
@@ -323,6 +323,9 @@ inline String toCoreString(v8::Handle<v8::String> value)
return v8StringToWebCoreString<String>(value, Externalize);
}
+// Convert a V8 value to a WTF::String.
+String toCoreString(v8::Isolate*, v8::Local<v8::Value>);
+
inline String toCoreStringWithNullCheck(v8::Handle<v8::String> value)
{
if (value.IsEmpty() || value->IsNull())
@@ -919,6 +922,9 @@ template<class Collection> static void indexedPropertyEnumerator(const v8::Prope
v8SetReturnValue(info, properties);
}
+bool isValidEnum(const String value, const char** validValues, size_t length);
+bool isValidEnum(const Vector<String>& values, const char** validValues, size_t length);
+
// These methods store hidden values into an array that is stored in the internal field of a DOM wrapper.
void addHiddenValueToArray(v8::Isolate*, v8::Handle<v8::Object>, v8::Local<v8::Value>, int cacheIndex);
void removeHiddenValueFromArray(v8::Isolate*, v8::Handle<v8::Object>, v8::Local<v8::Value>, int cacheIndex);

Powered by Google App Engine
This is Rietveld 408576698