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

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

Issue 74533003: Add Perl IDL support for method parameter type sequence<Dictionary> (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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/v8/V8Binding.h
diff --git a/Source/bindings/v8/V8Binding.h b/Source/bindings/v8/V8Binding.h
index 98d34c21affe8e6b2b0bacb5606f4c3c03558e35..505abbcdf79fe1023f790956364cba4814a57eac 100644
--- a/Source/bindings/v8/V8Binding.h
+++ b/Source/bindings/v8/V8Binding.h
@@ -33,6 +33,7 @@
#define V8Binding_h
#include "bindings/v8/DOMWrapperWorld.h"
+#include "bindings/v8/Dictionary.h"
#include "bindings/v8/ExceptionMessages.h"
#include "bindings/v8/V8BindingMacros.h"
#include "bindings/v8/V8PerIsolateData.h"
@@ -598,6 +599,20 @@ namespace WebCore {
return v8Value;
}
+ inline DictionarySequence toDictionarySequence(v8::Handle<v8::Value> value, int argumentIndex, v8::Isolate* isolate)
+ {
+ v8::Local<v8::Value> v8Value(v8::Local<v8::Value>::New(isolate, value));
+ uint32_t length = 0;
+ if (value->IsArray()) {
+ length = v8::Local<v8::Array>::Cast(v8Value)->Length();
+ } else if (toV8Sequence(value, length, isolate).IsEmpty()) {
+ throwTypeError(ExceptionMessages::notAnArrayTypeArgumentOrValue(argumentIndex), isolate);
+ return DictionarySequence();
+ }
+
+ return DictionarySequence(v8::Local<v8::Object>::Cast(v8Value), length, isolate);
+ }
+
PassRefPtr<NodeFilter> toNodeFilter(v8::Handle<v8::Value>, v8::Isolate*);
inline bool isUndefinedOrNull(v8::Handle<v8::Value> value)
« Source/bindings/scripts/code_generator_v8.pm ('K') | « Source/bindings/v8/Dictionary.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698