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

Side by Side Diff: Source/bindings/tests/results/V8TestDictionary.cpp

Issue 409373002: IDL: Binding code generation for dictionaries (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
12 namespace blink {
13
14 TestDictionary* V8TestDictionary::toNative(v8::Isolate* isolate, v8::Handle<v8:: Value> v8Value)
15 {
16 TestDictionary* impl = TestDictionary::create();
17 // FIXME: Do not use Dictionary and DictionaryHelper
18 // https://crbug.com/321462
19 Dictionary dictionary(v8Value, isolate);
20 bool booleanMember;
21 if (DictionaryHelper::get(dictionary, "booleanMember", booleanMember))
22 impl->setBooleanMember(booleanMember);
23 int longMember;
24 if (DictionaryHelper::get(dictionary, "longMember", longMember))
25 impl->setLongMember(longMember);
26 else
27 impl->setLongMember(1);
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 if (impl->hasLongMember())
37 v8Object->Set(v8String(isolate, "longMember"), v8::Integer::New(isolate, impl->longMember()));
38 else
39 v8Object->Set(v8String(isolate, "longMember"), v8::Integer::New(isolate, 1));
40 return v8Object;
41 }
42
43 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698