| 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 "V8TestInterfaceConstructor2.h" | 8 #include "V8TestInterfaceConstructor2.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 10 matching lines...) Expand all Loading... |
| 52 static void initializeScriptWrappableForInterface(TestInterfaceConstructor2* obj
ect) | 26 static void initializeScriptWrappableForInterface(TestInterfaceConstructor2* obj
ect) |
| 53 { | 27 { |
| 54 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 28 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
| 55 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfaceConstructor
2::wrapperTypeInfo); | 29 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfaceConstructor
2::wrapperTypeInfo); |
| 56 else | 30 else |
| 57 ASSERT_NOT_REACHED(); | 31 ASSERT_NOT_REACHED(); |
| 58 } | 32 } |
| 59 | 33 |
| 60 } // namespace WebCore | 34 } // namespace WebCore |
| 61 | 35 |
| 62 // In ScriptWrappable::init, the use of a local function declaration has an issu
e on Windows: | |
| 63 // the local declaration does not pick up the surrounding namespace. Therefore,
we provide this function | |
| 64 // in the global namespace. | |
| 65 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/fe
edback/details/664619/the-namespace-of-local-function-declarations-in-c) | |
| 66 void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfaceConstruc
tor2* object) | 36 void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfaceConstruc
tor2* object) |
| 67 { | 37 { |
| 68 WebCore::initializeScriptWrappableForInterface(object); | 38 WebCore::initializeScriptWrappableForInterface(object); |
| 69 } | 39 } |
| 70 | 40 |
| 71 namespace WebCore { | 41 namespace WebCore { |
| 72 const WrapperTypeInfo V8TestInterfaceConstructor2::wrapperTypeInfo = { gin::kEmb
edderBlink, V8TestInterfaceConstructor2::domTemplate, V8TestInterfaceConstructor
2::derefObject, 0, 0, 0, V8TestInterfaceConstructor2::installPerContextEnabledMe
thods, 0, WrapperTypeObjectPrototype, false }; | 42 const WrapperTypeInfo V8TestInterfaceConstructor2::wrapperTypeInfo = { gin::kEmb
edderBlink, V8TestInterfaceConstructor2::domTemplate, V8TestInterfaceConstructor
2::derefObject, 0, 0, 0, V8TestInterfaceConstructor2::installPerContextEnabledMe
thods, 0, WrapperTypeObjectPrototype, false }; |
| 73 | 43 |
| 74 namespace TestInterfaceConstructor2V8Internal { | 44 namespace TestInterfaceConstructor2V8Internal { |
| 75 | 45 |
| 76 template <typename T> void V8_USE(T) { } | 46 template <typename T> void V8_USE(T) { } |
| 77 | 47 |
| 78 static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info) | 48 static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 79 { | 49 { |
| 50 v8::Isolate* isolate = info.GetIsolate(); |
| 80 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, stringArg, info[0])
; | 51 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, stringArg, info[0])
; |
| 81 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(s
tringArg); | 52 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(s
tringArg); |
| 82 | 53 |
| 83 v8::Handle<v8::Object> wrapper = info.Holder(); | 54 v8::Handle<v8::Object> wrapper = info.Holder(); |
| 84 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor2>(impl.r
elease(), &V8TestInterfaceConstructor2::wrapperTypeInfo, wrapper, info.GetIsolat
e(), WrapperConfiguration::Independent); | 55 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor2>(impl.r
elease(), &V8TestInterfaceConstructor2::wrapperTypeInfo, wrapper, isolate, Wrapp
erConfiguration::Independent); |
| 85 v8SetReturnValue(info, wrapper); | 56 v8SetReturnValue(info, wrapper); |
| 86 } | 57 } |
| 87 | 58 |
| 88 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info) | 59 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 89 { | 60 { |
| 90 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor2", info.Holder(), info.GetIsolate()); | 61 v8::Isolate* isolate = info.GetIsolate(); |
| 62 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor2", info.Holder(), isolate); |
| 91 V8TRYCATCH_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceE
mpty::toNativeWithTypeCheck(info.GetIsolate(), info[0])); | 63 V8TRYCATCH_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceE
mpty::toNativeWithTypeCheck(info.GetIsolate(), info[0])); |
| 92 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[1], exceptionState), ex
ceptionState); | 64 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[1], exceptionState), ex
ceptionState); |
| 93 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, defaultUndefinedOpt
ionalStringArg, info[2]); | 65 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, defaultUndefinedOpt
ionalStringArg, info[2]); |
| 94 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, defaultNullStringOp
tionalStringArg, argumentOrNull(info, 3)); | 66 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, defaultNullStringOp
tionalStringArg, argumentOrNull(info, 3)); |
| 95 V8TRYCATCH_VOID(Dictionary, defaultUndefinedOptionalDictionaryArg, Dictionar
y(info[4], info.GetIsolate())); | 67 V8TRYCATCH_VOID(Dictionary, defaultUndefinedOptionalDictionaryArg, Dictionar
y(info[4], info.GetIsolate())); |
| 96 if (!defaultUndefinedOptionalDictionaryArg.isUndefinedOrNull() && !defaultUn
definedOptionalDictionaryArg.isObject()) { | 68 if (!defaultUndefinedOptionalDictionaryArg.isUndefinedOrNull() && !defaultUn
definedOptionalDictionaryArg.isObject()) { |
| 97 exceptionState.throwTypeError("parameter 5 ('defaultUndefinedOptionalDic
tionaryArg') is not an object."); | 69 exceptionState.throwTypeError("parameter 5 ('defaultUndefinedOptionalDic
tionaryArg') is not an object."); |
| 98 exceptionState.throwIfNeeded(); | 70 exceptionState.throwIfNeeded(); |
| 99 return; | 71 return; |
| 100 } | 72 } |
| 101 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(t
estInterfaceEmptyArg, longArg, defaultUndefinedOptionalStringArg, defaultNullStr
ingOptionalStringArg, defaultUndefinedOptionalDictionaryArg); | 73 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(t
estInterfaceEmptyArg, longArg, defaultUndefinedOptionalStringArg, defaultNullStr
ingOptionalStringArg, defaultUndefinedOptionalDictionaryArg); |
| 102 | 74 |
| 103 v8::Handle<v8::Object> wrapper = info.Holder(); | 75 v8::Handle<v8::Object> wrapper = info.Holder(); |
| 104 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor2>(impl.r
elease(), &V8TestInterfaceConstructor2::wrapperTypeInfo, wrapper, info.GetIsolat
e(), WrapperConfiguration::Independent); | 76 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor2>(impl.r
elease(), &V8TestInterfaceConstructor2::wrapperTypeInfo, wrapper, isolate, Wrapp
erConfiguration::Independent); |
| 105 v8SetReturnValue(info, wrapper); | 77 v8SetReturnValue(info, wrapper); |
| 106 } | 78 } |
| 107 | 79 |
| 108 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) | 80 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 109 { | 81 { |
| 110 if (((info.Length() == 1))) { | 82 if (((info.Length() == 1))) { |
| 111 TestInterfaceConstructor2V8Internal::constructor1(info); | 83 TestInterfaceConstructor2V8Internal::constructor1(info); |
| 112 return; | 84 return; |
| 113 } | 85 } |
| 114 if (((info.Length() == 2) && (V8TestInterfaceEmpty::hasInstance(info[0], inf
o.GetIsolate()))) || ((info.Length() == 3) && (V8TestInterfaceEmpty::hasInstance
(info[0], info.GetIsolate()))) || ((info.Length() == 4) && (V8TestInterfaceEmpty
::hasInstance(info[0], info.GetIsolate()))) || ((info.Length() == 5) && (V8TestI
nterfaceEmpty::hasInstance(info[0], info.GetIsolate())) && (info[4]->IsUndefined
() || info[4]->IsObject()))) { | 86 if (((info.Length() == 2) && (V8TestInterfaceEmpty::hasInstance(info[0], inf
o.GetIsolate()))) || ((info.Length() == 3) && (V8TestInterfaceEmpty::hasInstance
(info[0], info.GetIsolate()))) || ((info.Length() == 4) && (V8TestInterfaceEmpty
::hasInstance(info[0], info.GetIsolate()))) || ((info.Length() == 5) && (V8TestI
nterfaceEmpty::hasInstance(info[0], info.GetIsolate())) && (info[4]->IsUndefined
() || info[4]->IsObject()))) { |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 fromInternalPointer(object)->deref(); | 188 fromInternalPointer(object)->deref(); |
| 217 } | 189 } |
| 218 | 190 |
| 219 template<> | 191 template<> |
| 220 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor2* impl, v8::Handle<v
8::Object> creationContext, v8::Isolate* isolate) | 192 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor2* impl, v8::Handle<v
8::Object> creationContext, v8::Isolate* isolate) |
| 221 { | 193 { |
| 222 return toV8(impl, creationContext, isolate); | 194 return toV8(impl, creationContext, isolate); |
| 223 } | 195 } |
| 224 | 196 |
| 225 } // namespace WebCore | 197 } // namespace WebCore |
| OLD | NEW |