OLD | NEW |
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 "V8TestInterfaceConstructor4.h" | 7 #include "V8TestInterfaceConstructor4.h" |
8 | 8 |
9 #include "bindings/core/v8/ExceptionState.h" | 9 #include "bindings/core/v8/ExceptionState.h" |
10 #include "bindings/core/v8/GeneratedCodeHelper.h" | 10 #include "bindings/core/v8/GeneratedCodeHelper.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 decltype(&ScriptWrappable::hasPendingActivity)>::value, | 45 decltype(&ScriptWrappable::hasPendingActivity)>::value, |
46 "TestInterfaceConstructor4 is overriding hasPendingActivity(), but is not sp
ecifying " | 46 "TestInterfaceConstructor4 is overriding hasPendingActivity(), but is not sp
ecifying " |
47 "[ActiveScriptWrappable] extended attribute in the IDL file. " | 47 "[ActiveScriptWrappable] extended attribute in the IDL file. " |
48 "Be consistent."); | 48 "Be consistent."); |
49 | 49 |
50 namespace TestInterfaceConstructor4V8Internal { | 50 namespace TestInterfaceConstructor4V8Internal { |
51 | 51 |
52 static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info) | 52 static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info) |
53 { | 53 { |
54 TestInterfaceConstructor4* testInterface4Arg; | 54 TestInterfaceConstructor4* testInterface4Arg; |
55 { | 55 testInterface4Arg = V8TestInterfaceConstructor4::toImplWithTypeCheck(info.Ge
tIsolate(), info[0]); |
56 testInterface4Arg = V8TestInterfaceConstructor4::toImplWithTypeCheck(inf
o.GetIsolate(), info[0]); | 56 if (!testInterface4Arg) { |
57 if (!testInterface4Arg) { | 57 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::f
ailedToConstruct("TestInterfaceConstructor4", "parameter 1 is not of type 'TestI
nterfaceConstructor4'.")); |
58 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessage
s::failedToConstruct("TestInterfaceConstructor4", "parameter 1 is not of type 'T
estInterfaceConstructor4'.")); | 58 |
59 return; | 59 return; |
60 } | |
61 } | 60 } |
| 61 |
62 TestInterfaceConstructor4* impl = TestInterfaceConstructor4::create(testInte
rface4Arg); | 62 TestInterfaceConstructor4* impl = TestInterfaceConstructor4::create(testInte
rface4Arg); |
63 v8::Local<v8::Object> wrapper = info.Holder(); | 63 v8::Local<v8::Object> wrapper = info.Holder(); |
64 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructor4::wrapperTypeInfo, wrapper); | 64 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructor4::wrapperTypeInfo, wrapper); |
65 v8SetReturnValue(info, wrapper); | 65 v8SetReturnValue(info, wrapper); |
66 } | 66 } |
67 | 67 |
68 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info) | 68 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info) |
69 { | 69 { |
70 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor4", info.Holder(), info.GetIsolate()); | 70 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::Constructio
nContext, "TestInterfaceConstructor4"); |
| 71 |
71 V8StringResource<> usvStringArg; | 72 V8StringResource<> usvStringArg; |
72 { | 73 usvStringArg = toUSVString(info.GetIsolate(), info[0], exceptionState); |
73 usvStringArg = toUSVString(info.GetIsolate(), info[0], exceptionState); | 74 if (exceptionState.hadException()) |
74 if (exceptionState.hadException()) | 75 return; |
75 return; | 76 |
76 } | |
77 TestInterfaceConstructor4* impl = TestInterfaceConstructor4::create(usvStrin
gArg); | 77 TestInterfaceConstructor4* impl = TestInterfaceConstructor4::create(usvStrin
gArg); |
78 v8::Local<v8::Object> wrapper = info.Holder(); | 78 v8::Local<v8::Object> wrapper = info.Holder(); |
79 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructor4::wrapperTypeInfo, wrapper); | 79 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructor4::wrapperTypeInfo, wrapper); |
80 v8SetReturnValue(info, wrapper); | 80 v8SetReturnValue(info, wrapper); |
81 } | 81 } |
82 | 82 |
83 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) | 83 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) |
84 { | 84 { |
85 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::Constructio
nContext, "TestInterfaceConstructor4"); | 85 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::Constructio
nContext, "TestInterfaceConstructor4"); |
86 switch (std::min(1, info.Length())) { | 86 switch (std::min(1, info.Length())) { |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 { | 147 { |
148 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); | 148 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); |
149 } | 149 } |
150 | 150 |
151 TestInterfaceConstructor4* V8TestInterfaceConstructor4::toImplWithTypeCheck(v8::
Isolate* isolate, v8::Local<v8::Value> value) | 151 TestInterfaceConstructor4* V8TestInterfaceConstructor4::toImplWithTypeCheck(v8::
Isolate* isolate, v8::Local<v8::Value> value) |
152 { | 152 { |
153 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : nullptr; | 153 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : nullptr; |
154 } | 154 } |
155 | 155 |
156 } // namespace blink | 156 } // namespace blink |
OLD | NEW |