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

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

Issue 938403007: Support [TypeChecking] on dependent/partial interfaces. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: follow naming convention for to_list helper 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
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 "V8TestInterface3.h" 8 #include "V8TestInterface3.h"
9 9
10 #include "bindings/core/v8/ExceptionState.h" 10 #include "bindings/core/v8/ExceptionState.h"
11 #include "bindings/core/v8/ScriptState.h" 11 #include "bindings/core/v8/ScriptState.h"
12 #include "bindings/core/v8/ScriptValue.h" 12 #include "bindings/core/v8/ScriptValue.h"
13 #include "bindings/core/v8/V8DOMConfiguration.h" 13 #include "bindings/core/v8/V8DOMConfiguration.h"
14 #include "bindings/core/v8/V8Document.h"
14 #include "bindings/core/v8/V8HiddenValue.h" 15 #include "bindings/core/v8/V8HiddenValue.h"
15 #include "bindings/core/v8/V8Iterator.h" 16 #include "bindings/core/v8/V8Iterator.h"
16 #include "bindings/core/v8/V8Node.h" 17 #include "bindings/core/v8/V8Node.h"
17 #include "bindings/core/v8/V8ObjectConstructor.h" 18 #include "bindings/core/v8/V8ObjectConstructor.h"
19 #include "bindings/tests/idls/core/TestPartialInterface4.h"
18 #include "core/dom/ContextFeatures.h" 20 #include "core/dom/ContextFeatures.h"
19 #include "core/dom/Document.h" 21 #include "core/dom/Document.h"
20 #include "platform/RuntimeEnabledFeatures.h" 22 #include "platform/RuntimeEnabledFeatures.h"
21 #include "platform/TraceEvent.h" 23 #include "platform/TraceEvent.h"
22 #include "wtf/GetPtr.h" 24 #include "wtf/GetPtr.h"
23 #include "wtf/RefPtr.h" 25 #include "wtf/RefPtr.h"
24 26
25 namespace blink { 27 namespace blink {
26 28
27 const WrapperTypeInfo V8TestInterface3::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterface3::domTemplate, V8TestInterface3::refObject, V8TestInterface3::d erefObject, V8TestInterface3::trace, 0, V8TestInterface3::visitDOMWrapper, V8Tes tInterface3::installConditionallyEnabledMethods, V8TestInterface3::installCondit ionallyEnabledProperties, 0, WrapperTypeInfo::WrapperTypeObjectPrototype, Wrappe rTypeInfo::ObjectClassId, WrapperTypeInfo::NotInheritFromEventTarget, WrapperTyp eInfo::Dependent, WrapperTypeInfo::RefCountedObject }; 29 const WrapperTypeInfo V8TestInterface3::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterface3::domTemplate, V8TestInterface3::refObject, V8TestInterface3::d erefObject, V8TestInterface3::trace, 0, V8TestInterface3::visitDOMWrapper, V8Tes tInterface3::installConditionallyEnabledMethods, V8TestInterface3::installCondit ionallyEnabledProperties, 0, WrapperTypeInfo::WrapperTypeObjectPrototype, Wrappe rTypeInfo::ObjectClassId, WrapperTypeInfo::NotInheritFromEventTarget, WrapperTyp eInfo::Dependent, WrapperTypeInfo::RefCountedObject };
28 30
29 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac e3.h. 31 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac e3.h.
30 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in 32 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in
31 // bindings/core/v8/ScriptWrappable.h. 33 // bindings/core/v8/ScriptWrappable.h.
32 const WrapperTypeInfo& TestInterface3::s_wrapperTypeInfo = V8TestInterface3::wra pperTypeInfo; 34 const WrapperTypeInfo& TestInterface3::s_wrapperTypeInfo = V8TestInterface3::wra pperTypeInfo;
33 35
34 namespace TestInterface3V8Internal { 36 namespace TestInterface3V8Internal {
35 37
38 static void voidMethodDocumentMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
39 {
40 if (UNLIKELY(info.Length() < 1)) {
41 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod(in fo.GetIsolate(), "voidMethodDocument", "TestInterface3", 1, info.Length()), info .GetIsolate());
42 return;
43 }
44 TestInterface3* impl = V8TestInterface3::toImpl(info.Holder());
45 Document* document;
46 {
47 document = V8Document::toImplWithTypeCheck(info.GetIsolate(), info[0]);
48 }
49 impl->voidMethodDocument(document);
50 }
51
52 static void voidMethodDocumentMethodCallback(const v8::FunctionCallbackInfo<v8:: Value>& info)
53 {
54 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
55 TestInterface3V8Internal::voidMethodDocumentMethod(info);
56 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
57 }
58
36 static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 59 static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
37 { 60 {
38 ExceptionState exceptionState(ExceptionState::ExecutionContext, "keys", "Tes tInterface3", info.Holder(), info.GetIsolate()); 61 ExceptionState exceptionState(ExceptionState::ExecutionContext, "keys", "Tes tInterface3", info.Holder(), info.GetIsolate());
39 TestInterface3* impl = V8TestInterface3::toImpl(info.Holder()); 62 TestInterface3* impl = V8TestInterface3::toImpl(info.Holder());
40 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 63 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
41 RawPtr<Iterator> result = impl->iterableKeys(scriptState, exceptionState); 64 RawPtr<Iterator> result = impl->iterableKeys(scriptState, exceptionState);
42 if (exceptionState.hadException()) { 65 if (exceptionState.hadException()) {
43 exceptionState.throwIfNeeded(); 66 exceptionState.throwIfNeeded();
44 return; 67 return;
45 } 68 }
46 v8SetReturnValue(info, result.release()); 69 v8SetReturnValue(info, result.release());
47 } 70 }
48 71
49 static void keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 72 static void keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
50 { 73 {
51 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 74 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
52 TestInterface3V8Internal::keysMethod(info); 75 TestInterface3V8Internal::keysMethod(info);
53 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 76 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
54 } 77 }
55 78
79 #if ENABLE(BAR)
80 static void voidMethodDocumentMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
81 {
82 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodD ocument", "TestInterface3", info.Holder(), info.GetIsolate());
83 if (UNLIKELY(info.Length() < 2)) {
84 setMinimumArityTypeError(exceptionState, 2, info.Length());
85 exceptionState.throwIfNeeded();
86 return;
87 }
88 Document* document;
89 double d;
90 {
91 document = V8Document::toImplWithTypeCheck(info.GetIsolate(), info[0]);
92 if (!document) {
93 exceptionState.throwTypeError("parameter 1 is not of type 'Document' .");
94 exceptionState.throwIfNeeded();
95 return;
96 }
97 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(d, toRestrictedDouble(info[1], exc eptionState), exceptionState);
98 }
99 TestPartialInterface4::voidMethodDocument(document, d);
100 }
101 #endif // ENABLE(BAR)
102
103 #if ENABLE(BAR)
104 static void voidMethodDocumentMethodCallback(const v8::FunctionCallbackInfo<v8:: Value>& info)
105 {
106 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
107 TestInterface3V8Internal::voidMethodDocumentMethod(info);
108 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
109 }
110 #endif // ENABLE(BAR)
111
56 static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 112 static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
57 { 113 {
58 ExceptionState exceptionState(ExceptionState::ExecutionContext, "values", "T estInterface3", info.Holder(), info.GetIsolate()); 114 ExceptionState exceptionState(ExceptionState::ExecutionContext, "values", "T estInterface3", info.Holder(), info.GetIsolate());
59 TestInterface3* impl = V8TestInterface3::toImpl(info.Holder()); 115 TestInterface3* impl = V8TestInterface3::toImpl(info.Holder());
60 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 116 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
61 RawPtr<Iterator> result = impl->valuesForBinding(scriptState, exceptionState ); 117 RawPtr<Iterator> result = impl->valuesForBinding(scriptState, exceptionState );
62 if (exceptionState.hadException()) { 118 if (exceptionState.hadException()) {
63 exceptionState.throwIfNeeded(); 119 exceptionState.throwIfNeeded();
64 return; 120 return;
65 } 121 }
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 255
200 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A rray>& info) 256 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A rray>& info)
201 { 257 {
202 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); 258 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty");
203 V8TestInterface3::namedPropertyEnumeratorCustom(info); 259 V8TestInterface3::namedPropertyEnumeratorCustom(info);
204 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 260 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
205 } 261 }
206 262
207 } // namespace TestInterface3V8Internal 263 } // namespace TestInterface3V8Internal
208 264
265 static const V8DOMConfiguration::MethodConfiguration V8TestInterface3Methods[] = {
266 {"voidMethodDocument", TestInterface3V8Internal::voidMethodDocumentMethodCal lback, 0, 1, V8DOMConfiguration::ExposedToAllScripts},
267 };
268
209 static void installV8TestInterface3Template(v8::Local<v8::FunctionTemplate> func tionTemplate, v8::Isolate* isolate) 269 static void installV8TestInterface3Template(v8::Local<v8::FunctionTemplate> func tionTemplate, v8::Isolate* isolate)
210 { 270 {
211 functionTemplate->ReadOnlyPrototype(); 271 functionTemplate->ReadOnlyPrototype();
212 272
213 v8::Local<v8::Signature> defaultSignature; 273 v8::Local<v8::Signature> defaultSignature;
214 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, func tionTemplate, "TestInterface3", v8::Local<v8::FunctionTemplate>(), V8TestInterfa ce3::internalFieldCount, 274 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, func tionTemplate, "TestInterface3", v8::Local<v8::FunctionTemplate>(), V8TestInterfa ce3::internalFieldCount,
215 0, 0, 275 0, 0,
216 0, 0, 276 0, 0,
217 0, 0); 277 V8TestInterface3Methods, WTF_ARRAY_LENGTH(V8TestInterface3Methods));
218 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT emplate(); 278 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT emplate();
219 ALLOW_UNUSED_LOCAL(instanceTemplate); 279 ALLOW_UNUSED_LOCAL(instanceTemplate);
220 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp eTemplate(); 280 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp eTemplate();
221 ALLOW_UNUSED_LOCAL(prototypeTemplate); 281 ALLOW_UNUSED_LOCAL(prototypeTemplate);
222 { 282 {
223 v8::IndexedPropertyHandlerConfiguration config(TestInterface3V8Internal: :indexedPropertyGetterCallback, TestInterface3V8Internal::indexedPropertySetterC allback, 0, TestInterface3V8Internal::indexedPropertyDeleterCallback, indexedPro pertyEnumerator<TestInterface3>); 283 v8::IndexedPropertyHandlerConfiguration config(TestInterface3V8Internal: :indexedPropertyGetterCallback, TestInterface3V8Internal::indexedPropertySetterC allback, 0, TestInterface3V8Internal::indexedPropertyDeleterCallback, indexedPro pertyEnumerator<TestInterface3>);
224 functionTemplate->InstanceTemplate()->SetHandler(config); 284 functionTemplate->InstanceTemplate()->SetHandler(config);
225 } 285 }
226 { 286 {
227 v8::NamedPropertyHandlerConfiguration config(TestInterface3V8Internal::n amedPropertyGetterCallback, TestInterface3V8Internal::namedPropertySetterCallbac k, TestInterface3V8Internal::namedPropertyQueryCallback, TestInterface3V8Interna l::namedPropertyDeleterCallback, TestInterface3V8Internal::namedPropertyEnumerat orCallback); 287 v8::NamedPropertyHandlerConfiguration config(TestInterface3V8Internal::n amedPropertyGetterCallback, TestInterface3V8Internal::namedPropertySetterCallbac k, TestInterface3V8Internal::namedPropertyQueryCallback, TestInterface3V8Interna l::namedPropertyDeleterCallback, TestInterface3V8Internal::namedPropertyEnumerat orCallback);
228 functionTemplate->InstanceTemplate()->SetHandler(config); 288 functionTemplate->InstanceTemplate()->SetHandler(config);
229 } 289 }
230 if (RuntimeEnabledFeatures::featureNameEnabled()) { 290 if (RuntimeEnabledFeatures::featureNameEnabled()) {
231 static const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKe yedIteratorConfiguration = { v8::Symbol::GetIterator, TestInterface3V8Internal:: iteratorMethodCallback, 0, V8DOMConfiguration::ExposedToAllScripts }; 291 static const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKe yedIteratorConfiguration = { v8::Symbol::GetIterator, TestInterface3V8Internal:: iteratorMethodCallback, 0, V8DOMConfiguration::ExposedToAllScripts };
232 V8DOMConfiguration::installMethod(isolate, prototypeTemplate, defaultSig nature, v8::DontDelete, symbolKeyedIteratorConfiguration); 292 V8DOMConfiguration::installMethod(isolate, prototypeTemplate, defaultSig nature, v8::DontDelete, symbolKeyedIteratorConfiguration);
233 } 293 }
234 if (RuntimeEnabledFeatures::featureNameEnabled()) { 294 if (RuntimeEnabledFeatures::featureNameEnabled()) {
235 const V8DOMConfiguration::MethodConfiguration keysMethodConfiguration = { 295 const V8DOMConfiguration::MethodConfiguration keysMethodConfiguration = {
236 "keys", TestInterface3V8Internal::keysMethodCallback, 0, 0, V8DOMCon figuration::ExposedToAllScripts, 296 "keys", TestInterface3V8Internal::keysMethodCallback, 0, 0, V8DOMCon figuration::ExposedToAllScripts,
237 }; 297 };
238 V8DOMConfiguration::installMethod(isolate, prototypeTemplate, defaultSig nature, v8::None, keysMethodConfiguration); 298 V8DOMConfiguration::installMethod(isolate, prototypeTemplate, defaultSig nature, v8::None, keysMethodConfiguration);
239 } 299 }
300 #if ENABLE(BAR)
301 const V8DOMConfiguration::MethodConfiguration voidMethodDocumentMethodConfig uration = {
302 "voidMethodDocument", TestInterface3V8Internal::voidMethodDocumentMethod Callback, 0, 2, V8DOMConfiguration::ExposedToAllScripts,
303 };
304 V8DOMConfiguration::installMethod(isolate, functionTemplate, v8::Local<v8::S ignature>(), v8::None, voidMethodDocumentMethodConfiguration);
305 #endif // ENABLE(BAR)
240 if (RuntimeEnabledFeatures::featureNameEnabled()) { 306 if (RuntimeEnabledFeatures::featureNameEnabled()) {
241 const V8DOMConfiguration::MethodConfiguration valuesMethodConfiguration = { 307 const V8DOMConfiguration::MethodConfiguration valuesMethodConfiguration = {
242 "values", TestInterface3V8Internal::valuesMethodCallback, 0, 0, V8DO MConfiguration::ExposedToAllScripts, 308 "values", TestInterface3V8Internal::valuesMethodCallback, 0, 0, V8DO MConfiguration::ExposedToAllScripts,
243 }; 309 };
244 V8DOMConfiguration::installMethod(isolate, prototypeTemplate, defaultSig nature, v8::None, valuesMethodConfiguration); 310 V8DOMConfiguration::installMethod(isolate, prototypeTemplate, defaultSig nature, v8::None, valuesMethodConfiguration);
245 } 311 }
246 if (RuntimeEnabledFeatures::featureNameEnabled()) { 312 if (RuntimeEnabledFeatures::featureNameEnabled()) {
247 const V8DOMConfiguration::MethodConfiguration entriesMethodConfiguration = { 313 const V8DOMConfiguration::MethodConfiguration entriesMethodConfiguration = {
248 "entries", TestInterface3V8Internal::entriesMethodCallback, 0, 0, V8 DOMConfiguration::ExposedToAllScripts, 314 "entries", TestInterface3V8Internal::entriesMethodCallback, 0, 0, V8 DOMConfiguration::ExposedToAllScripts,
249 }; 315 };
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 { 350 {
285 scriptWrappable->toImpl<TestInterface3>()->ref(); 351 scriptWrappable->toImpl<TestInterface3>()->ref();
286 } 352 }
287 353
288 void V8TestInterface3::derefObject(ScriptWrappable* scriptWrappable) 354 void V8TestInterface3::derefObject(ScriptWrappable* scriptWrappable)
289 { 355 {
290 scriptWrappable->toImpl<TestInterface3>()->deref(); 356 scriptWrappable->toImpl<TestInterface3>()->deref();
291 } 357 }
292 358
293 } // namespace blink 359 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/tests/idls/core/TestPartialInterface4.idl ('k') | Tools/Scripts/webkitpy/bindings/main.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698