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

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

Issue 680193003: IDL: Generate union type containers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6 6
7 #include "config.h" 7 #include "config.h"
8 #include "V8TestSpecialOperations.h" 8 #include "V8TestSpecialOperations.h"
9 9
10 #include "bindings/core/v8/ExceptionState.h" 10 #include "bindings/core/v8/ExceptionState.h"
11 #include "bindings/core/v8/UnionTypesCore.h"
11 #include "bindings/core/v8/V8DOMConfiguration.h" 12 #include "bindings/core/v8/V8DOMConfiguration.h"
12 #include "bindings/core/v8/V8HiddenValue.h" 13 #include "bindings/core/v8/V8HiddenValue.h"
13 #include "bindings/core/v8/V8Node.h" 14 #include "bindings/core/v8/V8Node.h"
14 #include "bindings/core/v8/V8NodeList.h" 15 #include "bindings/core/v8/V8NodeList.h"
15 #include "bindings/core/v8/V8ObjectConstructor.h" 16 #include "bindings/core/v8/V8ObjectConstructor.h"
16 #include "core/dom/ContextFeatures.h" 17 #include "core/dom/ContextFeatures.h"
17 #include "core/dom/Document.h" 18 #include "core/dom/Document.h"
18 #include "core/dom/NameNodeList.h" 19 #include "core/dom/NameNodeList.h"
19 #include "core/dom/NodeList.h" 20 #include "core/dom/NodeList.h"
20 #include "core/dom/StaticNodeList.h" 21 #include "core/dom/StaticNodeList.h"
(...skipping 18 matching lines...) Expand all
39 { 40 {
40 if (UNLIKELY(info.Length() < 1)) { 41 if (UNLIKELY(info.Length() < 1)) {
41 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("n amedItem", "TestSpecialOperations", 1, info.Length(), info.GetIsolate()), info.G etIsolate()); 42 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("n amedItem", "TestSpecialOperations", 1, info.Length(), info.GetIsolate()), info.G etIsolate());
42 return; 43 return;
43 } 44 }
44 TestSpecialOperations* impl = V8TestSpecialOperations::toImpl(info.Holder()) ; 45 TestSpecialOperations* impl = V8TestSpecialOperations::toImpl(info.Holder()) ;
45 V8StringResource<> name; 46 V8StringResource<> name;
46 { 47 {
47 TOSTRING_VOID_INTERNAL(name, info[0]); 48 TOSTRING_VOID_INTERNAL(name, info[0]);
48 } 49 }
49 RefPtrWillBeRawPtr<Node> result0 = nullptr; 50 NodeOrNodeList result;
50 RefPtrWillBeRawPtr<NodeList> result1 = nullptr; 51 impl->getItem(name, result);
51 impl->getItem(name, result0, result1); 52 if (result.isNode()) {
52 if (result0) { 53 v8SetReturnValue(info, result.getAsNode());
53 v8SetReturnValue(info, result0.release());
54 return; 54 return;
55 } 55 }
56 if (result1) { 56 if (result.isNodeList()) {
57 v8SetReturnValue(info, result1.release()); 57 v8SetReturnValue(info, result.getAsNodeList());
58 return; 58 return;
59 } 59 }
60 v8SetReturnValueNull(info); 60 v8SetReturnValueNull(info);
61 } 61 }
62 62
63 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i nfo) 63 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i nfo)
64 { 64 {
65 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 65 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
66 TestSpecialOperationsV8Internal::namedItemMethod(info); 66 TestSpecialOperationsV8Internal::namedItemMethod(info);
67 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 67 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
68 } 68 }
69 69
70 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa llbackInfo<v8::Value>& info) 70 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa llbackInfo<v8::Value>& info)
71 { 71 {
72 TestSpecialOperations* impl = V8TestSpecialOperations::toImpl(info.Holder()) ; 72 TestSpecialOperations* impl = V8TestSpecialOperations::toImpl(info.Holder()) ;
73 AtomicString propertyName = toCoreAtomicString(name); 73 AtomicString propertyName = toCoreAtomicString(name);
74 RefPtrWillBeRawPtr<Node> result0 = nullptr; 74 NodeOrNodeList result;
75 RefPtrWillBeRawPtr<NodeList> result1 = nullptr; 75 impl->getItem(propertyName, result);
76 impl->getItem(propertyName, result0, result1); 76 if (result.isNull())
77 if (!(result0 || result1))
78 return; 77 return;
79 if (result0) { 78 if (result.isNode()) {
80 v8SetReturnValue(info, result0.release()); 79 v8SetReturnValue(info, result.getAsNode());
81 return; 80 return;
82 } 81 }
83 if (result1) { 82 if (result.isNodeList()) {
84 v8SetReturnValue(info, result1.release()); 83 v8SetReturnValue(info, result.getAsNodeList());
85 return; 84 return;
86 } 85 }
87 ASSERT_NOT_REACHED(); 86 ASSERT_NOT_REACHED();
88 } 87 }
89 88
90 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr opertyCallbackInfo<v8::Value>& info) 89 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr opertyCallbackInfo<v8::Value>& info)
91 { 90 {
92 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); 91 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty");
93 TestSpecialOperationsV8Internal::namedPropertyGetter(name, info); 92 TestSpecialOperationsV8Internal::namedPropertyGetter(name, info);
94 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 93 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 scriptWrappableBase->toImpl<TestSpecialOperations>()->deref(); 209 scriptWrappableBase->toImpl<TestSpecialOperations>()->deref();
211 } 210 }
212 211
213 template<> 212 template<>
214 v8::Handle<v8::Value> toV8NoInline(TestSpecialOperations* impl, v8::Handle<v8::O bject> creationContext, v8::Isolate* isolate) 213 v8::Handle<v8::Value> toV8NoInline(TestSpecialOperations* impl, v8::Handle<v8::O bject> creationContext, v8::Isolate* isolate)
215 { 214 {
216 return toV8(impl, creationContext, isolate); 215 return toV8(impl, creationContext, isolate);
217 } 216 }
218 217
219 } // namespace blink 218 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698