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

Side by Side Diff: Source/bindings/tests/results/core/TestInterfaceWillBeGarbageCollectedOrTestDictionary.cpp

Issue 953123003: IDL: Put generated union type containers in separate files (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2015 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 "TestInterfaceWillBeGarbageCollectedOrTestDictionary.h"
9
10
11 namespace blink {
12
13 TestInterfaceWillBeGarbageCollectedOrTestDictionary::TestInterfaceWillBeGarbageC ollectedOrTestDictionary()
14 : m_type(SpecificTypeNone)
15 {
16 }
17
18 PassRefPtrWillBeRawPtr<TestInterfaceWillBeGarbageCollected> TestInterfaceWillBeG arbageCollectedOrTestDictionary::getAsTestInterfaceWillBeGarbageCollected() cons t
19 {
20 ASSERT(isTestInterfaceWillBeGarbageCollected());
21 return m_testInterfaceWillBeGarbageCollected;
22 }
23
24 void TestInterfaceWillBeGarbageCollectedOrTestDictionary::setTestInterfaceWillBe GarbageCollected(PassRefPtrWillBeRawPtr<TestInterfaceWillBeGarbageCollected> val ue)
25 {
26 ASSERT(isNull());
27 m_testInterfaceWillBeGarbageCollected = value;
28 m_type = SpecificTypeTestInterfaceWillBeGarbageCollected;
29 }
30
31 TestInterfaceWillBeGarbageCollectedOrTestDictionary TestInterfaceWillBeGarbageCo llectedOrTestDictionary::fromTestInterfaceWillBeGarbageCollected(PassRefPtrWillB eRawPtr<TestInterfaceWillBeGarbageCollected> value)
32 {
33 TestInterfaceWillBeGarbageCollectedOrTestDictionary container;
34 container.setTestInterfaceWillBeGarbageCollected(value);
35 return container;
36 }
37
38 TestDictionary TestInterfaceWillBeGarbageCollectedOrTestDictionary::getAsTestDic tionary() const
39 {
40 ASSERT(isTestDictionary());
41 return m_testDictionary;
42 }
43
44 void TestInterfaceWillBeGarbageCollectedOrTestDictionary::setTestDictionary(Test Dictionary value)
45 {
46 ASSERT(isNull());
47 m_testDictionary = value;
48 m_type = SpecificTypeTestDictionary;
49 }
50
51 TestInterfaceWillBeGarbageCollectedOrTestDictionary TestInterfaceWillBeGarbageCo llectedOrTestDictionary::fromTestDictionary(TestDictionary value)
52 {
53 TestInterfaceWillBeGarbageCollectedOrTestDictionary container;
54 container.setTestDictionary(value);
55 return container;
56 }
57
58 DEFINE_TRACE(TestInterfaceWillBeGarbageCollectedOrTestDictionary)
59 {
60 visitor->trace(m_testInterfaceWillBeGarbageCollected);
61 visitor->trace(m_testDictionary);
62 }
63
64 void V8TestInterfaceWillBeGarbageCollectedOrTestDictionary::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, TestInterfaceWillBeGarbageCollectedOrTest Dictionary& impl, ExceptionState& exceptionState)
65 {
66 if (v8Value.IsEmpty())
67 return;
68
69 if (V8TestInterfaceWillBeGarbageCollected::hasInstance(v8Value, isolate)) {
70 RefPtrWillBeRawPtr<TestInterfaceWillBeGarbageCollected> cppValue = V8Tes tInterfaceWillBeGarbageCollected::toImpl(v8::Local<v8::Object>::Cast(v8Value));
71 impl.setTestInterfaceWillBeGarbageCollected(cppValue);
72 return;
73 }
74
75 if (isUndefinedOrNull(v8Value) || v8Value->IsObject()) {
76 TestDictionary cppValue;
77 TONATIVE_VOID_EXCEPTIONSTATE_ARGINTERNAL(V8TestDictionary::toImpl(isolat e, v8Value, cppValue, exceptionState), exceptionState);
78 impl.setTestDictionary(cppValue);
79 return;
80 }
81
82 exceptionState.throwTypeError("The provided value is not of type '(TestInter faceWillBeGarbageCollected or TestDictionary)'");
83 }
84
85 v8::Local<v8::Value> toV8(const TestInterfaceWillBeGarbageCollectedOrTestDiction ary& impl, v8::Local<v8::Object> creationContext, v8::Isolate* isolate)
86 {
87 switch (impl.m_type) {
88 case TestInterfaceWillBeGarbageCollectedOrTestDictionary::SpecificTypeNone:
89 return v8::Null(isolate);
90 case TestInterfaceWillBeGarbageCollectedOrTestDictionary::SpecificTypeTestIn terfaceWillBeGarbageCollected:
91 return toV8(impl.getAsTestInterfaceWillBeGarbageCollected(), creationCon text, isolate);
92 case TestInterfaceWillBeGarbageCollectedOrTestDictionary::SpecificTypeTestDi ctionary:
93 return toV8(impl.getAsTestDictionary(), creationContext, isolate);
94 default:
95 ASSERT_NOT_REACHED();
96 }
97 return v8::Local<v8::Value>();
98 }
99
100 TestInterfaceWillBeGarbageCollectedOrTestDictionary NativeValueTraits<TestInterf aceWillBeGarbageCollectedOrTestDictionary>::nativeValue(const v8::Local<v8::Valu e>& value, v8::Isolate* isolate, ExceptionState& exceptionState)
101 {
102 TestInterfaceWillBeGarbageCollectedOrTestDictionary impl;
103 V8TestInterfaceWillBeGarbageCollectedOrTestDictionary::toImpl(isolate, value , impl, exceptionState);
104 return impl;
105 }
106
107 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698