OLD | NEW |
1 /* | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 // Use of this source code is governed by a BSD-style license that can be |
3 * | 3 // found in the LICENSE file. |
4 * Redistribution and use in source and binary forms, with or without | |
5 * modification, are permitted provided that the following conditions are | |
6 * met: | |
7 * | |
8 * * Redistributions of source code must retain the above copyright | |
9 * notice, this list of conditions and the following disclaimer. | |
10 * * Redistributions in binary form must reproduce the above | |
11 * copyright notice, this list of conditions and the following disclaimer | |
12 * in the documentation and/or other materials provided with the | |
13 * distribution. | |
14 * * Neither the name of Google Inc. nor the names of its | |
15 * contributors may be used to endorse or promote products derived from | |
16 * this software without specific prior written permission. | |
17 * | |
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
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. | |
29 */ | |
30 | 4 |
31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY! | 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! |
32 | 6 |
33 #include "config.h" | 7 #include "config.h" |
34 #include "V8TestInterfaceConstructor.h" | 8 #include "V8TestInterfaceConstructor.h" |
35 | 9 |
36 #include "RuntimeEnabledFeatures.h" | 10 #include "RuntimeEnabledFeatures.h" |
37 #include "V8TestInterfaceEmpty.h" | 11 #include "V8TestInterfaceEmpty.h" |
38 #include "bindings/v8/Dictionary.h" | 12 #include "bindings/v8/Dictionary.h" |
39 #include "bindings/v8/ExceptionState.h" | 13 #include "bindings/v8/ExceptionState.h" |
40 #include "bindings/v8/V8DOMConfiguration.h" | 14 #include "bindings/v8/V8DOMConfiguration.h" |
41 #include "bindings/v8/V8HiddenValue.h" | 15 #include "bindings/v8/V8HiddenValue.h" |
(...skipping 11 matching lines...) Expand all Loading... |
53 static void initializeScriptWrappableForInterface(TestInterfaceConstructor* obje
ct) | 27 static void initializeScriptWrappableForInterface(TestInterfaceConstructor* obje
ct) |
54 { | 28 { |
55 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 29 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
56 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfaceConstructor
::wrapperTypeInfo); | 30 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfaceConstructor
::wrapperTypeInfo); |
57 else | 31 else |
58 ASSERT_NOT_REACHED(); | 32 ASSERT_NOT_REACHED(); |
59 } | 33 } |
60 | 34 |
61 } // namespace WebCore | 35 } // namespace WebCore |
62 | 36 |
63 // In ScriptWrappable::init, the use of a local function declaration has an issu
e on Windows: | |
64 // the local declaration does not pick up the surrounding namespace. Therefore,
we provide this function | |
65 // in the global namespace. | |
66 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/fe
edback/details/664619/the-namespace-of-local-function-declarations-in-c) | |
67 void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfaceConstruc
tor* object) | 37 void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfaceConstruc
tor* object) |
68 { | 38 { |
69 WebCore::initializeScriptWrappableForInterface(object); | 39 WebCore::initializeScriptWrappableForInterface(object); |
70 } | 40 } |
71 | 41 |
72 namespace WebCore { | 42 namespace WebCore { |
73 const WrapperTypeInfo V8TestInterfaceConstructor::wrapperTypeInfo = { gin::kEmbe
dderBlink, V8TestInterfaceConstructor::domTemplate, V8TestInterfaceConstructor::
derefObject, 0, 0, 0, V8TestInterfaceConstructor::installPerContextEnabledMethod
s, 0, WrapperTypeObjectPrototype, false }; | 43 const WrapperTypeInfo V8TestInterfaceConstructor::wrapperTypeInfo = { gin::kEmbe
dderBlink, V8TestInterfaceConstructor::domTemplate, V8TestInterfaceConstructor::
derefObject, 0, 0, 0, V8TestInterfaceConstructor::installPerContextEnabledMethod
s, 0, WrapperTypeObjectPrototype, false }; |
74 | 44 |
75 namespace TestInterfaceConstructorV8Internal { | 45 namespace TestInterfaceConstructorV8Internal { |
76 | 46 |
77 template <typename T> void V8_USE(T) { } | 47 template <typename T> void V8_USE(T) { } |
78 | 48 |
79 static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info) | 49 static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info) |
80 { | 50 { |
81 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor", info.Holder(), info.GetIsolate()); | 51 v8::Isolate* isolate = info.GetIsolate(); |
82 ExecutionContext* context = currentExecutionContext(info.GetIsolate()); | 52 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor", info.Holder(), isolate); |
83 Document& document = *toDocument(currentExecutionContext(info.GetIsolate()))
; | 53 ExecutionContext* context = currentExecutionContext(isolate); |
| 54 Document& document = *toDocument(currentExecutionContext(isolate)); |
84 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(con
text, document, exceptionState); | 55 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(con
text, document, exceptionState); |
85 if (exceptionState.throwIfNeeded()) | 56 if (exceptionState.throwIfNeeded()) |
86 return; | 57 return; |
87 | 58 |
88 v8::Handle<v8::Object> wrapper = info.Holder(); | 59 v8::Handle<v8::Object> wrapper = info.Holder(); |
89 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor>(impl.re
lease(), &V8TestInterfaceConstructor::wrapperTypeInfo, wrapper, info.GetIsolate(
), WrapperConfiguration::Independent); | 60 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor>(impl.re
lease(), &V8TestInterfaceConstructor::wrapperTypeInfo, wrapper, isolate, Wrapper
Configuration::Independent); |
90 v8SetReturnValue(info, wrapper); | 61 v8SetReturnValue(info, wrapper); |
91 } | 62 } |
92 | 63 |
93 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info) | 64 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info) |
94 { | 65 { |
95 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor", info.Holder(), info.GetIsolate()); | 66 v8::Isolate* isolate = info.GetIsolate(); |
| 67 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor", info.Holder(), isolate); |
96 V8TRYCATCH_VOID(double, doubleArg, static_cast<double>(info[0]->NumberValue(
))); | 68 V8TRYCATCH_VOID(double, doubleArg, static_cast<double>(info[0]->NumberValue(
))); |
97 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, stringArg, info[1])
; | 69 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, stringArg, info[1])
; |
98 V8TRYCATCH_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceE
mpty::toNativeWithTypeCheck(info.GetIsolate(), info[2])); | 70 V8TRYCATCH_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceE
mpty::toNativeWithTypeCheck(info.GetIsolate(), info[2])); |
99 V8TRYCATCH_VOID(Dictionary, dictionaryArg, Dictionary(info[3], info.GetIsola
te())); | 71 V8TRYCATCH_VOID(Dictionary, dictionaryArg, Dictionary(info[3], info.GetIsola
te())); |
100 if (!dictionaryArg.isUndefinedOrNull() && !dictionaryArg.isObject()) { | 72 if (!dictionaryArg.isUndefinedOrNull() && !dictionaryArg.isObject()) { |
101 exceptionState.throwTypeError("parameter 4 ('dictionaryArg') is not an o
bject."); | 73 exceptionState.throwTypeError("parameter 4 ('dictionaryArg') is not an o
bject."); |
102 exceptionState.throwIfNeeded(); | 74 exceptionState.throwIfNeeded(); |
103 return; | 75 return; |
104 } | 76 } |
105 V8TRYCATCH_VOID(Vector<String>, sequenceStringArg, toNativeArray<String>(inf
o[4], 5, info.GetIsolate())); | 77 V8TRYCATCH_VOID(Vector<String>, sequenceStringArg, toNativeArray<String>(inf
o[4], 5, info.GetIsolate())); |
106 V8TRYCATCH_VOID(Vector<Dictionary>, sequenceDictionaryArg, toNativeArray<Dic
tionary>(info[5], 6, info.GetIsolate())); | 78 V8TRYCATCH_VOID(Vector<Dictionary>, sequenceDictionaryArg, toNativeArray<Dic
tionary>(info[5], 6, info.GetIsolate())); |
107 V8TRYCATCH_VOID(Dictionary, optionalDictionaryArg, Dictionary(info[6], info.
GetIsolate())); | 79 V8TRYCATCH_VOID(Dictionary, optionalDictionaryArg, Dictionary(info[6], info.
GetIsolate())); |
108 if (!optionalDictionaryArg.isUndefinedOrNull() && !optionalDictionaryArg.isO
bject()) { | 80 if (!optionalDictionaryArg.isUndefinedOrNull() && !optionalDictionaryArg.isO
bject()) { |
109 exceptionState.throwTypeError("parameter 7 ('optionalDictionaryArg') is
not an object."); | 81 exceptionState.throwTypeError("parameter 7 ('optionalDictionaryArg') is
not an object."); |
110 exceptionState.throwIfNeeded(); | 82 exceptionState.throwIfNeeded(); |
111 return; | 83 return; |
112 } | 84 } |
113 V8TRYCATCH_VOID(TestInterfaceEmpty*, optionalTestInterfaceEmptyArg, V8TestIn
terfaceEmpty::toNativeWithTypeCheck(info.GetIsolate(), info[7])); | 85 V8TRYCATCH_VOID(TestInterfaceEmpty*, optionalTestInterfaceEmptyArg, V8TestIn
terfaceEmpty::toNativeWithTypeCheck(info.GetIsolate(), info[7])); |
114 ExecutionContext* context = currentExecutionContext(info.GetIsolate()); | 86 ExecutionContext* context = currentExecutionContext(isolate); |
115 Document& document = *toDocument(currentExecutionContext(info.GetIsolate()))
; | 87 Document& document = *toDocument(currentExecutionContext(isolate)); |
116 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(con
text, document, doubleArg, stringArg, testInterfaceEmptyArg, dictionaryArg, sequ
enceStringArg, sequenceDictionaryArg, optionalDictionaryArg, optionalTestInterfa
ceEmptyArg, exceptionState); | 88 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(con
text, document, doubleArg, stringArg, testInterfaceEmptyArg, dictionaryArg, sequ
enceStringArg, sequenceDictionaryArg, optionalDictionaryArg, optionalTestInterfa
ceEmptyArg, exceptionState); |
117 if (exceptionState.throwIfNeeded()) | 89 if (exceptionState.throwIfNeeded()) |
118 return; | 90 return; |
119 | 91 |
120 v8::Handle<v8::Object> wrapper = info.Holder(); | 92 v8::Handle<v8::Object> wrapper = info.Holder(); |
121 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor>(impl.re
lease(), &V8TestInterfaceConstructor::wrapperTypeInfo, wrapper, info.GetIsolate(
), WrapperConfiguration::Independent); | 93 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor>(impl.re
lease(), &V8TestInterfaceConstructor::wrapperTypeInfo, wrapper, isolate, Wrapper
Configuration::Independent); |
122 v8SetReturnValue(info, wrapper); | 94 v8SetReturnValue(info, wrapper); |
123 } | 95 } |
124 | 96 |
125 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) | 97 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) |
126 { | 98 { |
127 if (((info.Length() == 0))) { | 99 if (((info.Length() == 0))) { |
128 TestInterfaceConstructorV8Internal::constructor1(info); | 100 TestInterfaceConstructorV8Internal::constructor1(info); |
129 return; | 101 return; |
130 } | 102 } |
131 if (((info.Length() == 6) && (V8TestInterfaceEmpty::hasInstance(info[2], inf
o.GetIsolate())) && (info[3]->IsObject()) && (info[4]->IsArray()) && (info[5]->I
sArray())) || ((info.Length() == 7) && (V8TestInterfaceEmpty::hasInstance(info[2
], info.GetIsolate())) && (info[3]->IsObject()) && (info[4]->IsArray()) && (info
[5]->IsArray()) && (info[6]->IsUndefined() || info[6]->IsObject())) || ((info.Le
ngth() == 8) && (V8TestInterfaceEmpty::hasInstance(info[2], info.GetIsolate()))
&& (info[3]->IsObject()) && (info[4]->IsArray()) && (info[5]->IsArray()) && (inf
o[6]->IsUndefined() || info[6]->IsObject()) && (V8TestInterfaceEmpty::hasInstanc
e(info[7], info.GetIsolate())))) { | 103 if (((info.Length() == 6) && (V8TestInterfaceEmpty::hasInstance(info[2], inf
o.GetIsolate())) && (info[3]->IsObject()) && (info[4]->IsArray()) && (info[5]->I
sArray())) || ((info.Length() == 7) && (V8TestInterfaceEmpty::hasInstance(info[2
], info.GetIsolate())) && (info[3]->IsObject()) && (info[4]->IsArray()) && (info
[5]->IsArray()) && (info[6]->IsUndefined() || info[6]->IsObject())) || ((info.Le
ngth() == 8) && (V8TestInterfaceEmpty::hasInstance(info[2], info.GetIsolate()))
&& (info[3]->IsObject()) && (info[4]->IsArray()) && (info[5]->IsArray()) && (inf
o[6]->IsUndefined() || info[6]->IsObject()) && (V8TestInterfaceEmpty::hasInstanc
e(info[7], info.GetIsolate())))) { |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 fromInternalPointer(object)->deref(); | 199 fromInternalPointer(object)->deref(); |
228 } | 200 } |
229 | 201 |
230 template<> | 202 template<> |
231 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor* impl, v8::Handle<v8
::Object> creationContext, v8::Isolate* isolate) | 203 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor* impl, v8::Handle<v8
::Object> creationContext, v8::Isolate* isolate) |
232 { | 204 { |
233 return toV8(impl, creationContext, isolate); | 205 return toV8(impl, creationContext, isolate); |
234 } | 206 } |
235 | 207 |
236 } // namespace WebCore | 208 } // namespace WebCore |
OLD | NEW |