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

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

Issue 741783003: Bindings: Support [ConstructorCallWith=ScriptState] (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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
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 "V8TestInterfaceConstructor.h" 8 #include "V8TestInterfaceConstructor.h"
9 9
10 #include "bindings/core/v8/Dictionary.h" 10 #include "bindings/core/v8/Dictionary.h"
(...skipping 18 matching lines...) Expand all
29 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac eConstructor.h. 29 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac eConstructor.h.
30 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in 30 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in
31 // bindings/core/v8/ScriptWrappable.h. 31 // bindings/core/v8/ScriptWrappable.h.
32 const WrapperTypeInfo& TestInterfaceConstructor::s_wrapperTypeInfo = V8TestInter faceConstructor::wrapperTypeInfo; 32 const WrapperTypeInfo& TestInterfaceConstructor::s_wrapperTypeInfo = V8TestInter faceConstructor::wrapperTypeInfo;
33 33
34 namespace TestInterfaceConstructorV8Internal { 34 namespace TestInterfaceConstructorV8Internal {
35 35
36 static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info) 36 static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info)
37 { 37 {
38 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), info.GetIsolate()); 38 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), info.GetIsolate());
39 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
39 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ()); 40 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ());
40 Document& document = *toDocument(currentExecutionContext(info.GetIsolate())) ; 41 Document& document = *toDocument(currentExecutionContext(info.GetIsolate())) ;
41 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(exe cutionContext, document, exceptionState); 42 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(scr iptState, executionContext, document, exceptionState);
42 if (exceptionState.hadException()) { 43 if (exceptionState.hadException()) {
43 exceptionState.throwIfNeeded(); 44 exceptionState.throwIfNeeded();
44 return; 45 return;
45 } 46 }
46 v8::Handle<v8::Object> wrapper = info.Holder(); 47 v8::Handle<v8::Object> wrapper = info.Holder();
47 impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstructor::w rapperTypeInfo, wrapper); 48 impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstructor::w rapperTypeInfo, wrapper);
48 v8SetReturnValue(info, wrapper); 49 v8SetReturnValue(info, wrapper);
49 } 50 }
50 51
51 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info) 52 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info)
(...skipping 20 matching lines...) Expand all
72 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(sequenceStringArg, toImplArray<Str ing>(info[4], 5, info.GetIsolate(), exceptionState), exceptionState); 73 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(sequenceStringArg, toImplArray<Str ing>(info[4], 5, info.GetIsolate(), exceptionState), exceptionState);
73 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(sequenceDictionaryArg, toImplArray <Dictionary>(info[5], 6, info.GetIsolate(), exceptionState), exceptionState); 74 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(sequenceDictionaryArg, toImplArray <Dictionary>(info[5], 6, info.GetIsolate(), exceptionState), exceptionState);
74 if (!isUndefinedOrNull(info[6]) && !info[6]->IsObject()) { 75 if (!isUndefinedOrNull(info[6]) && !info[6]->IsObject()) {
75 exceptionState.throwTypeError("parameter 7 ('optionalDictionaryArg') is not an object."); 76 exceptionState.throwTypeError("parameter 7 ('optionalDictionaryArg') is not an object.");
76 exceptionState.throwIfNeeded(); 77 exceptionState.throwIfNeeded();
77 return; 78 return;
78 } 79 }
79 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(optionalDictionaryArg, Dictionary( info[6], info.GetIsolate(), exceptionState), exceptionState); 80 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(optionalDictionaryArg, Dictionary( info[6], info.GetIsolate(), exceptionState), exceptionState);
80 optionalTestInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeChec k(info.GetIsolate(), info[7]); 81 optionalTestInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeChec k(info.GetIsolate(), info[7]);
81 } 82 }
83 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
82 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ()); 84 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ());
83 Document& document = *toDocument(currentExecutionContext(info.GetIsolate())) ; 85 Document& document = *toDocument(currentExecutionContext(info.GetIsolate())) ;
84 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(exe cutionContext, document, doubleArg, stringArg, testInterfaceEmptyArg, dictionary Arg, sequenceStringArg, sequenceDictionaryArg, optionalDictionaryArg, optionalTe stInterfaceEmptyArg, exceptionState); 86 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(scr iptState, executionContext, document, doubleArg, stringArg, testInterfaceEmptyAr g, dictionaryArg, sequenceStringArg, sequenceDictionaryArg, optionalDictionaryAr g, optionalTestInterfaceEmptyArg, exceptionState);
85 if (exceptionState.hadException()) { 87 if (exceptionState.hadException()) {
86 exceptionState.throwIfNeeded(); 88 exceptionState.throwIfNeeded();
87 return; 89 return;
88 } 90 }
89 v8::Handle<v8::Object> wrapper = info.Holder(); 91 v8::Handle<v8::Object> wrapper = info.Holder();
90 impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstructor::w rapperTypeInfo, wrapper); 92 impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstructor::w rapperTypeInfo, wrapper);
91 v8SetReturnValue(info, wrapper); 93 v8SetReturnValue(info, wrapper);
92 } 94 }
93 95
94 static void constructor3(const v8::FunctionCallbackInfo<v8::Value>& info) 96 static void constructor3(const v8::FunctionCallbackInfo<v8::Value>& info)
95 { 97 {
96 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), info.GetIsolate()); 98 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), info.GetIsolate());
97 V8StringResource<> arg; 99 V8StringResource<> arg;
98 V8StringResource<> optArg; 100 V8StringResource<> optArg;
99 { 101 {
100 TOSTRING_VOID_INTERNAL(arg, info[0]); 102 TOSTRING_VOID_INTERNAL(arg, info[0]);
101 if (UNLIKELY(info.Length() <= 1)) { 103 if (UNLIKELY(info.Length() <= 1)) {
104 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
102 ExecutionContext* executionContext = currentExecutionContext(info.Ge tIsolate()); 105 ExecutionContext* executionContext = currentExecutionContext(info.Ge tIsolate());
103 Document& document = *toDocument(currentExecutionContext(info.GetIso late())); 106 Document& document = *toDocument(currentExecutionContext(info.GetIso late()));
104 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::cr eate(executionContext, document, arg, exceptionState); 107 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::cr eate(scriptState, executionContext, document, arg, exceptionState);
105 if (exceptionState.hadException()) { 108 if (exceptionState.hadException()) {
106 exceptionState.throwIfNeeded(); 109 exceptionState.throwIfNeeded();
107 return; 110 return;
108 } 111 }
109 v8::Handle<v8::Object> wrapper = info.Holder(); 112 v8::Handle<v8::Object> wrapper = info.Holder();
110 impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstr uctor::wrapperTypeInfo, wrapper); 113 impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstr uctor::wrapperTypeInfo, wrapper);
111 v8SetReturnValue(info, wrapper); 114 v8SetReturnValue(info, wrapper);
112 return; 115 return;
113 } 116 }
114 TOSTRING_VOID_INTERNAL(optArg, info[1]); 117 TOSTRING_VOID_INTERNAL(optArg, info[1]);
115 } 118 }
119 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
116 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ()); 120 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ());
117 Document& document = *toDocument(currentExecutionContext(info.GetIsolate())) ; 121 Document& document = *toDocument(currentExecutionContext(info.GetIsolate())) ;
118 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(exe cutionContext, document, arg, optArg, exceptionState); 122 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(scr iptState, executionContext, document, arg, optArg, exceptionState);
119 if (exceptionState.hadException()) { 123 if (exceptionState.hadException()) {
120 exceptionState.throwIfNeeded(); 124 exceptionState.throwIfNeeded();
121 return; 125 return;
122 } 126 }
123 v8::Handle<v8::Object> wrapper = info.Holder(); 127 v8::Handle<v8::Object> wrapper = info.Holder();
124 impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstructor::w rapperTypeInfo, wrapper); 128 impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstructor::w rapperTypeInfo, wrapper);
125 v8SetReturnValue(info, wrapper); 129 v8SetReturnValue(info, wrapper);
126 } 130 }
127 131
128 static void constructor4(const v8::FunctionCallbackInfo<v8::Value>& info) 132 static void constructor4(const v8::FunctionCallbackInfo<v8::Value>& info)
129 { 133 {
130 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), info.GetIsolate()); 134 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), info.GetIsolate());
131 V8StringResource<> arg; 135 V8StringResource<> arg;
132 V8StringResource<> arg2; 136 V8StringResource<> arg2;
133 V8StringResource<> arg3; 137 V8StringResource<> arg3;
134 { 138 {
135 TOSTRING_VOID_INTERNAL(arg, info[0]); 139 TOSTRING_VOID_INTERNAL(arg, info[0]);
136 TOSTRING_VOID_INTERNAL(arg2, info[1]); 140 TOSTRING_VOID_INTERNAL(arg2, info[1]);
137 TOSTRING_VOID_INTERNAL(arg3, info[2]); 141 TOSTRING_VOID_INTERNAL(arg3, info[2]);
138 } 142 }
143 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
139 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ()); 144 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ());
140 Document& document = *toDocument(currentExecutionContext(info.GetIsolate())) ; 145 Document& document = *toDocument(currentExecutionContext(info.GetIsolate())) ;
141 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(exe cutionContext, document, arg, arg2, arg3, exceptionState); 146 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(scr iptState, executionContext, document, arg, arg2, arg3, exceptionState);
142 if (exceptionState.hadException()) { 147 if (exceptionState.hadException()) {
143 exceptionState.throwIfNeeded(); 148 exceptionState.throwIfNeeded();
144 return; 149 return;
145 } 150 }
146 v8::Handle<v8::Object> wrapper = info.Holder(); 151 v8::Handle<v8::Object> wrapper = info.Holder();
147 impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstructor::w rapperTypeInfo, wrapper); 152 impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstructor::w rapperTypeInfo, wrapper);
148 v8SetReturnValue(info, wrapper); 153 v8SetReturnValue(info, wrapper);
149 } 154 }
150 155
151 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) 156 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 if (UNLIKELY(info.Length() < 1)) { 231 if (UNLIKELY(info.Length() < 1)) {
227 setMinimumArityTypeError(exceptionState, 1, info.Length()); 232 setMinimumArityTypeError(exceptionState, 1, info.Length());
228 exceptionState.throwIfNeeded(); 233 exceptionState.throwIfNeeded();
229 return; 234 return;
230 } 235 }
231 V8StringResource<> arg; 236 V8StringResource<> arg;
232 V8StringResource<> optArg; 237 V8StringResource<> optArg;
233 { 238 {
234 TOSTRING_VOID_INTERNAL(arg, info[0]); 239 TOSTRING_VOID_INTERNAL(arg, info[0]);
235 if (UNLIKELY(info.Length() <= 1)) { 240 if (UNLIKELY(info.Length() <= 1)) {
241 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
236 ExecutionContext* executionContext = currentExecutionContext(info.Ge tIsolate()); 242 ExecutionContext* executionContext = currentExecutionContext(info.Ge tIsolate());
237 Document& document = *toDocument(currentExecutionContext(info.GetIso late())); 243 Document& document = *toDocument(currentExecutionContext(info.GetIso late()));
238 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::cr eateForJSConstructor(executionContext, document, arg, exceptionState); 244 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::cr eateForJSConstructor(scriptState, executionContext, document, arg, exceptionStat e);
239 if (exceptionState.hadException()) { 245 if (exceptionState.hadException()) {
240 exceptionState.throwIfNeeded(); 246 exceptionState.throwIfNeeded();
241 return; 247 return;
242 } 248 }
243 v8::Handle<v8::Object> wrapper = info.Holder(); 249 v8::Handle<v8::Object> wrapper = info.Holder();
244 impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstr uctorConstructor::wrapperTypeInfo, wrapper); 250 impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstr uctorConstructor::wrapperTypeInfo, wrapper);
245 v8SetReturnValue(info, wrapper); 251 v8SetReturnValue(info, wrapper);
246 return; 252 return;
247 } 253 }
248 TOSTRING_VOID_INTERNAL(optArg, info[1]); 254 TOSTRING_VOID_INTERNAL(optArg, info[1]);
249 } 255 }
256 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
250 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ()); 257 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ());
251 Document& document = *toDocument(currentExecutionContext(info.GetIsolate())) ; 258 Document& document = *toDocument(currentExecutionContext(info.GetIsolate())) ;
252 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::createForJ SConstructor(executionContext, document, arg, optArg, exceptionState); 259 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::createForJ SConstructor(scriptState, executionContext, document, arg, optArg, exceptionStat e);
253 if (exceptionState.hadException()) { 260 if (exceptionState.hadException()) {
254 exceptionState.throwIfNeeded(); 261 exceptionState.throwIfNeeded();
255 return; 262 return;
256 } 263 }
257 v8::Handle<v8::Object> wrapper = info.Holder(); 264 v8::Handle<v8::Object> wrapper = info.Holder();
258 impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstructorCon structor::wrapperTypeInfo, wrapper); 265 impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstructorCon structor::wrapperTypeInfo, wrapper);
259 v8SetReturnValue(info, wrapper); 266 v8SetReturnValue(info, wrapper);
260 } 267 }
261 268
262 v8::Handle<v8::FunctionTemplate> V8TestInterfaceConstructorConstructor::domTempl ate(v8::Isolate* isolate) 269 v8::Handle<v8::FunctionTemplate> V8TestInterfaceConstructorConstructor::domTempl ate(v8::Isolate* isolate)
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 { 345 {
339 scriptWrappable->toImpl<TestInterfaceConstructor>()->ref(); 346 scriptWrappable->toImpl<TestInterfaceConstructor>()->ref();
340 } 347 }
341 348
342 void V8TestInterfaceConstructor::derefObject(ScriptWrappable* scriptWrappable) 349 void V8TestInterfaceConstructor::derefObject(ScriptWrappable* scriptWrappable)
343 { 350 {
344 scriptWrappable->toImpl<TestInterfaceConstructor>()->deref(); 351 scriptWrappable->toImpl<TestInterfaceConstructor>()->deref();
345 } 352 }
346 353
347 } // namespace blink 354 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698