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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6
7 #include "config.h"
8 #include "V8TestDictionary.h"
9
10 #include "bindings/core/v8/Dictionary.h"
11 #include "bindings/tests/v8/V8Node.h"
12 #include "bindings/tests/v8/V8TestInterface.h"
13
14 namespace WebCore {
15
16 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
17 {
18 TestDictionary* impl = TestDictionary::create();
19 // FIXME: Do not use Dictionary and DictionaryHelper
20 Dictionary dictionary(v8Value, isolate);
21 impl->m_hasBooleanMember = DictionaryHelper::get(dictionary, "booleanMember" , impl->m_booleanMember);
22 impl->m_hasLongMember = DictionaryHelper::get(dictionary, "longMember", impl ->m_longMember);
23 if (!impl->m_hasLongMember)
24 impl->setLongMember(1);
25 impl->m_hasNodeMember = DictionaryHelper::get(dictionary, "nodeMember", impl ->m_nodeMember);
26 impl->m_hasStringMember = DictionaryHelper::get(dictionary, "stringMember", impl->m_stringMember);
27 impl->m_hasTestInterfaceMember = DictionaryHelper::get(dictionary, "testInte rfaceMember", impl->m_testInterfaceMember);
28 return impl;
29 }
30
31 v8::Handle<v8::Value> toV8(TestDictionary* impl, v8::Handle<v8::Object> creation Context, v8::Isolate* isolate)
32 {
33 v8::Handle<v8::Object> v8Object = v8::Object::New(isolate);
34 if (impl->hasBooleanMember())
35 v8Object->Set(v8String(isolate, "booleanMember"), v8Boolean(impl->boolea nMember(), isolate));
36
37 if (impl->hasLongMember())
38 v8Object->Set(v8String(isolate, "longMember"), v8::Integer::New(isolate, impl->longMember()));
39 else
40 v8Object->Set(v8String(isolate, "longMember"), v8::Integer::New(isolate, 1));
41
42 if (impl->hasNodeMember())
43 v8Object->Set(v8String(isolate, "nodeMember"), toV8(impl->nodeMember(), creationContext, isolate));
44
45 if (impl->hasStringMember())
46 v8Object->Set(v8String(isolate, "stringMember"), v8String(isolate, impl- >stringMember()));
47
48 if (impl->hasTestInterfaceMember())
49 v8Object->Set(v8String(isolate, "testInterfaceMember"), toV8(impl->testI nterfaceMember(), creationContext, isolate));
50
51 return v8Object;
52 }
53
54 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698