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

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

Issue 99323009: IDL compiler: [Constructor] argument types (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Formatting Created 7 years 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
« no previous file with comments | « Source/bindings/tests/idls/TestInterfaceConstructor.idl ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 16 matching lines...) Expand all
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY! 31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
32 32
33 #include "config.h" 33 #include "config.h"
34 #include "V8TestInterfaceConstructor.h" 34 #include "V8TestInterfaceConstructor.h"
35 35
36 #include "RuntimeEnabledFeatures.h" 36 #include "RuntimeEnabledFeatures.h"
37 #include "V8TestInterfaceEmpty.h"
38 #include "bindings/v8/Dictionary.h"
37 #include "bindings/v8/ExceptionMessages.h" 39 #include "bindings/v8/ExceptionMessages.h"
38 #include "bindings/v8/V8DOMConfiguration.h" 40 #include "bindings/v8/V8DOMConfiguration.h"
39 #include "bindings/v8/V8ObjectConstructor.h" 41 #include "bindings/v8/V8ObjectConstructor.h"
40 #include "core/dom/ContextFeatures.h" 42 #include "core/dom/ContextFeatures.h"
41 #include "core/dom/Document.h" 43 #include "core/dom/Document.h"
42 #include "core/frame/UseCounter.h" 44 #include "core/frame/UseCounter.h"
43 #include "platform/TraceEvent.h" 45 #include "platform/TraceEvent.h"
44 46
45 namespace WebCore { 47 namespace WebCore {
46 48
(...skipping 18 matching lines...) Expand all
65 67
66 namespace WebCore { 68 namespace WebCore {
67 const WrapperTypeInfo V8TestInterfaceConstructor::wrapperTypeInfo = { gin::kEmbe dderBlink, V8TestInterfaceConstructor::domTemplate, V8TestInterfaceConstructor:: derefObject, 0, 0, 0, V8TestInterfaceConstructor::installPerContextEnabledMethod s, 0, WrapperTypeObjectPrototype }; 69 const WrapperTypeInfo V8TestInterfaceConstructor::wrapperTypeInfo = { gin::kEmbe dderBlink, V8TestInterfaceConstructor::domTemplate, V8TestInterfaceConstructor:: derefObject, 0, 0, 0, V8TestInterfaceConstructor::installPerContextEnabledMethod s, 0, WrapperTypeObjectPrototype };
68 70
69 namespace TestInterfaceConstructorV8Internal { 71 namespace TestInterfaceConstructorV8Internal {
70 72
71 template <typename T> void V8_USE(T) { } 73 template <typename T> void V8_USE(T) { }
72 74
73 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) 75 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
74 { 76 {
75 if (UNLIKELY(info.Length() < 2)) { 77 if (UNLIKELY(info.Length() < 5)) {
76 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestIn terfaceConstructor", ExceptionMessages::notEnoughArguments(2, info.Length())), i nfo.GetIsolate()); 78 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestIn terfaceConstructor", ExceptionMessages::notEnoughArguments(5, info.Length())), i nfo.GetIsolate());
77 return; 79 return;
78 } 80 }
79 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), info.GetIsolate()); 81 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), info.GetIsolate());
80 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, stringArgument, inf o[0]); 82 V8TRYCATCH_VOID(double, doubleArg, static_cast<double>(info[0]->NumberValue( )));
81 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, stringArgument2, in fo[1]); 83 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, stringArg, info[1]) ;
84 V8TRYCATCH_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceE mpty::hasInstance(info[2], info.GetIsolate(), worldType(info.GetIsolate())) ? V8 TestInterfaceEmpty::toNative(v8::Handle<v8::Object>::Cast(info[2])) : 0);
85 V8TRYCATCH_VOID(Dictionary, dictionaryArg, Dictionary(info[3], info.GetIsola te()));
86 if (!dictionaryArg.isUndefinedOrNull() && !dictionaryArg.isObject()) {
87 throwTypeError(ExceptionMessages::failedToConstruct("TestInterfaceConstr uctor", "parameter 4 ('dictionaryArg') is not an object."), info.GetIsolate());
88 return;
89 }
90 V8TRYCATCH_VOID(Vector<String>, sequenceStringArg, toNativeArray<String>(inf o[4], 5, info.GetIsolate()));
82 ExecutionContext* context = getExecutionContext(); 91 ExecutionContext* context = getExecutionContext();
83 Document& document = *toDocument(getExecutionContext()); 92 Document& document = *toDocument(getExecutionContext());
84 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(con text, document, stringArgument, stringArgument2, exceptionState); 93 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(con text, document, doubleArg, stringArg, testInterfaceEmptyArg, dictionaryArg, sequ enceStringArg, exceptionState);
85 v8::Handle<v8::Object> wrapper = info.Holder(); 94 v8::Handle<v8::Object> wrapper = info.Holder();
86 if (exceptionState.throwIfNeeded()) 95 if (exceptionState.throwIfNeeded())
87 return; 96 return;
88 97
89 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor>(impl.re lease(), &V8TestInterfaceConstructor::wrapperTypeInfo, wrapper, info.GetIsolate( ), WrapperConfiguration::Dependent); 98 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor>(impl.re lease(), &V8TestInterfaceConstructor::wrapperTypeInfo, wrapper, info.GetIsolate( ), WrapperConfiguration::Dependent);
90 v8SetReturnValue(info, wrapper); 99 v8SetReturnValue(info, wrapper);
91 } 100 }
92 101
93 } // namespace TestInterfaceConstructorV8Internal 102 } // namespace TestInterfaceConstructorV8Internal
94 103
(...skipping 18 matching lines...) Expand all
113 { 122 {
114 functionTemplate->ReadOnlyPrototype(); 123 functionTemplate->ReadOnlyPrototype();
115 124
116 v8::Local<v8::Signature> defaultSignature; 125 v8::Local<v8::Signature> defaultSignature;
117 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl ate, "TestInterfaceConstructor", v8::Local<v8::FunctionTemplate>(), V8TestInterf aceConstructor::internalFieldCount, 126 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl ate, "TestInterfaceConstructor", v8::Local<v8::FunctionTemplate>(), V8TestInterf aceConstructor::internalFieldCount,
118 0, 0, 127 0, 0,
119 0, 0, 128 0, 0,
120 0, 0, 129 0, 0,
121 isolate, currentWorldType); 130 isolate, currentWorldType);
122 functionTemplate->SetCallHandler(V8TestInterfaceConstructor::constructorCall back); 131 functionTemplate->SetCallHandler(V8TestInterfaceConstructor::constructorCall back);
123 functionTemplate->SetLength(2); 132 functionTemplate->SetLength(5);
124 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla te->InstanceTemplate(); 133 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla te->InstanceTemplate();
125 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl ate->PrototypeTemplate(); 134 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl ate->PrototypeTemplate();
126 135
127 // Custom toString template 136 // Custom toString template
128 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); 137 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate());
129 return functionTemplate; 138 return functionTemplate;
130 } 139 }
131 140
132 v8::Handle<v8::FunctionTemplate> V8TestInterfaceConstructor::domTemplate(v8::Iso late* isolate, WrapperWorldType currentWorldType) 141 v8::Handle<v8::FunctionTemplate> V8TestInterfaceConstructor::domTemplate(v8::Iso late* isolate, WrapperWorldType currentWorldType)
133 { 142 {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 fromInternalPointer(object)->deref(); 190 fromInternalPointer(object)->deref();
182 } 191 }
183 192
184 template<> 193 template<>
185 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor* impl, v8::Handle<v8 ::Object> creationContext, v8::Isolate* isolate) 194 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor* impl, v8::Handle<v8 ::Object> creationContext, v8::Isolate* isolate)
186 { 195 {
187 return toV8(impl, creationContext, isolate); 196 return toV8(impl, creationContext, isolate);
188 } 197 }
189 198
190 } // namespace WebCore 199 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/idls/TestInterfaceConstructor.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698