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

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 v8SetReturnValue(info, result);
52 if (result0) {
53 v8SetReturnValue(info, result0.release());
54 return;
55 }
56 if (result1) {
57 v8SetReturnValue(info, result1.release());
58 return;
59 }
60 v8SetReturnValueNull(info);
61 } 53 }
62 54
63 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i nfo) 55 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i nfo)
64 { 56 {
65 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 57 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
66 TestSpecialOperationsV8Internal::namedItemMethod(info); 58 TestSpecialOperationsV8Internal::namedItemMethod(info);
67 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 59 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
68 } 60 }
69 61
70 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa llbackInfo<v8::Value>& info) 62 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa llbackInfo<v8::Value>& info)
71 { 63 {
72 TestSpecialOperations* impl = V8TestSpecialOperations::toImpl(info.Holder()) ; 64 TestSpecialOperations* impl = V8TestSpecialOperations::toImpl(info.Holder()) ;
73 AtomicString propertyName = toCoreAtomicString(name); 65 AtomicString propertyName = toCoreAtomicString(name);
74 RefPtrWillBeRawPtr<Node> result0 = nullptr; 66 NodeOrNodeList result;
75 RefPtrWillBeRawPtr<NodeList> result1 = nullptr; 67 impl->getItem(propertyName, result);
76 impl->getItem(propertyName, result0, result1); 68 if (result.isNull())
77 if (!(result0 || result1))
78 return; 69 return;
79 if (result0) { 70 v8SetReturnValue(info, result);
80 v8SetReturnValue(info, result0.release());
81 return;
82 }
83 if (result1) {
84 v8SetReturnValue(info, result1.release());
85 return;
86 }
87 ASSERT_NOT_REACHED();
88 } 71 }
89 72
90 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr opertyCallbackInfo<v8::Value>& info) 73 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr opertyCallbackInfo<v8::Value>& info)
91 { 74 {
92 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); 75 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty");
93 TestSpecialOperationsV8Internal::namedPropertyGetter(name, info); 76 TestSpecialOperationsV8Internal::namedPropertyGetter(name, info);
94 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 77 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
95 } 78 }
96 79
97 static void namedPropertySetter(v8::Local<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) 80 static void namedPropertySetter(v8::Local<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 scriptWrappableBase->toImpl<TestSpecialOperations>()->deref(); 193 scriptWrappableBase->toImpl<TestSpecialOperations>()->deref();
211 } 194 }
212 195
213 template<> 196 template<>
214 v8::Handle<v8::Value> toV8NoInline(TestSpecialOperations* impl, v8::Handle<v8::O bject> creationContext, v8::Isolate* isolate) 197 v8::Handle<v8::Value> toV8NoInline(TestSpecialOperations* impl, v8::Handle<v8::O bject> creationContext, v8::Isolate* isolate)
215 { 198 {
216 return toV8(impl, creationContext, isolate); 199 return toV8(impl, creationContext, isolate);
217 } 200 }
218 201
219 } // namespace blink 202 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698