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

Unified Diff: Source/bindings/tests/results/V8TestDictionary.cpp

Issue 386963003: [WIP][NotForLand] IDL dictionary support (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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/tests/results/V8TestDictionary.cpp
diff --git a/Source/bindings/tests/results/V8TestDictionary.cpp b/Source/bindings/tests/results/V8TestDictionary.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..76172cd2f367429f4a0b9cc6210f7ccaad0457b2
--- /dev/null
+++ b/Source/bindings/tests/results/V8TestDictionary.cpp
@@ -0,0 +1,54 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
+
+#include "config.h"
+#include "V8TestDictionary.h"
+
+#include "bindings/core/v8/Dictionary.h"
+#include "bindings/tests/v8/V8Node.h"
+#include "bindings/tests/v8/V8TestInterface.h"
+
+namespace WebCore {
+
+TestDictionary* V8TestDictionary::toNativeWithTypeCheck(v8::Isolate* isolate, v8::Handle<v8::Value> v8Value)
haraken 2014/07/21 16:11:59 I'd rename this to toNative(). toNativeWithTypeCh
bashi 2014/07/22 02:33:58 Thank you for the explanation. I was wondering I s
haraken 2014/07/22 04:30:10 Understood, then we can probably: - Add the if(v8
bashi 2014/07/22 05:57:35 I think this method should be toNative() because i
haraken 2014/07/22 07:23:19 Makes sense; I agree that we keep the current impl
+{
+ TestDictionary* impl = TestDictionary::create();
+ // FIXME: Do not use Dictionary and DictionaryHelper
+ Dictionary dictionary(v8Value, isolate);
+ impl->m_hasBooleanMember = DictionaryHelper::get(dictionary, "booleanMember", impl->m_booleanMember);
+ impl->m_hasLongMember = DictionaryHelper::get(dictionary, "longMember", impl->m_longMember);
+ if (!impl->m_hasLongMember)
+ impl->setLongMember(1);
+ impl->m_hasNodeMember = DictionaryHelper::get(dictionary, "nodeMember", impl->m_nodeMember);
+ impl->m_hasStringMember = DictionaryHelper::get(dictionary, "stringMember", impl->m_stringMember);
+ impl->m_hasTestInterfaceMember = DictionaryHelper::get(dictionary, "testInterfaceMember", impl->m_testInterfaceMember);
+ return impl;
+}
+
+v8::Handle<v8::Value> toV8(TestDictionary* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ v8::Handle<v8::Object> v8Object = v8::Object::New(isolate);
+ if (impl->hasBooleanMember())
+ v8Object->Set(v8String(isolate, "booleanMember"), v8Boolean(impl->booleanMember(), isolate));
+
+ if (impl->hasLongMember())
+ v8Object->Set(v8String(isolate, "longMember"), v8::Integer::New(isolate, impl->longMember()));
+ else
+ v8Object->Set(v8String(isolate, "longMember"), v8::Integer::New(isolate, 1));
+
+ if (impl->hasNodeMember())
+ v8Object->Set(v8String(isolate, "nodeMember"), toV8(impl->nodeMember(), creationContext, isolate));
+
+ if (impl->hasStringMember())
+ v8Object->Set(v8String(isolate, "stringMember"), v8String(isolate, impl->stringMember()));
+
+ if (impl->hasTestInterfaceMember())
+ v8Object->Set(v8String(isolate, "testInterfaceMember"), toV8(impl->testInterfaceMember(), creationContext, isolate));
+
+ return v8Object;
+}
+
+} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698