| OLD | NEW |
| 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 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 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 "V8TestInterfaceConstructor2.h" |
| 35 | 35 |
| 36 #include "RuntimeEnabledFeatures.h" | 36 #include "RuntimeEnabledFeatures.h" |
| 37 #include "V8TestInterfaceEmpty.h" | 37 #include "V8TestInterfaceEmpty.h" |
| 38 #include "bindings/v8/Dictionary.h" | 38 #include "bindings/v8/Dictionary.h" |
| 39 #include "bindings/v8/ExceptionState.h" | 39 #include "bindings/v8/ExceptionState.h" |
| 40 #include "bindings/v8/V8DOMConfiguration.h" | 40 #include "bindings/v8/V8DOMConfiguration.h" |
| 41 #include "bindings/v8/V8ObjectConstructor.h" | 41 #include "bindings/v8/V8ObjectConstructor.h" |
| 42 #include "core/dom/ContextFeatures.h" | 42 #include "core/dom/ContextFeatures.h" |
| 43 #include "core/dom/Document.h" | 43 #include "core/dom/Document.h" |
| 44 #include "core/frame/UseCounter.h" | |
| 45 #include "platform/TraceEvent.h" | 44 #include "platform/TraceEvent.h" |
| 46 | 45 |
| 47 namespace WebCore { | 46 namespace WebCore { |
| 48 | 47 |
| 49 static void initializeScriptWrappableForInterface(TestInterfaceConstructor* obje
ct) | 48 static void initializeScriptWrappableForInterface(TestInterfaceConstructor2* obj
ect) |
| 50 { | 49 { |
| 51 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 50 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
| 52 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfaceConstructor
::wrapperTypeInfo); | 51 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfaceConstructor
2::wrapperTypeInfo); |
| 53 else | 52 else |
| 54 ASSERT_NOT_REACHED(); | 53 ASSERT_NOT_REACHED(); |
| 55 } | 54 } |
| 56 | 55 |
| 57 } // namespace WebCore | 56 } // namespace WebCore |
| 58 | 57 |
| 59 // In ScriptWrappable::init, the use of a local function declaration has an issu
e on Windows: | 58 // In ScriptWrappable::init, the use of a local function declaration has an issu
e on Windows: |
| 60 // the local declaration does not pick up the surrounding namespace. Therefore,
we provide this function | 59 // the local declaration does not pick up the surrounding namespace. Therefore,
we provide this function |
| 61 // in the global namespace. | 60 // in the global namespace. |
| 62 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/fe
edback/details/664619/the-namespace-of-local-function-declarations-in-c) | 61 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/fe
edback/details/664619/the-namespace-of-local-function-declarations-in-c) |
| 63 void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfaceConstruc
tor* object) | 62 void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfaceConstruc
tor2* object) |
| 64 { | 63 { |
| 65 WebCore::initializeScriptWrappableForInterface(object); | 64 WebCore::initializeScriptWrappableForInterface(object); |
| 66 } | 65 } |
| 67 | 66 |
| 68 namespace WebCore { | 67 namespace WebCore { |
| 69 const WrapperTypeInfo V8TestInterfaceConstructor::wrapperTypeInfo = { gin::kEmbe
dderBlink, V8TestInterfaceConstructor::domTemplate, V8TestInterfaceConstructor::
derefObject, 0, 0, 0, V8TestInterfaceConstructor::installPerContextEnabledMethod
s, 0, WrapperTypeObjectPrototype }; | 68 const WrapperTypeInfo V8TestInterfaceConstructor2::wrapperTypeInfo = { gin::kEmb
edderBlink, V8TestInterfaceConstructor2::domTemplate, V8TestInterfaceConstructor
2::derefObject, 0, 0, 0, V8TestInterfaceConstructor2::installPerContextEnabledMe
thods, 0, WrapperTypeObjectPrototype }; |
| 70 | 69 |
| 71 namespace TestInterfaceConstructorV8Internal { | 70 namespace TestInterfaceConstructor2V8Internal { |
| 72 | 71 |
| 73 template <typename T> void V8_USE(T) { } | 72 template <typename T> void V8_USE(T) { } |
| 74 | 73 |
| 75 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) | 74 static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 76 { | 75 { |
| 77 if (UNLIKELY(info.Length() < 5)) { | 76 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, stringArg, info[0])
; |
| 78 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestIn
terfaceConstructor", ExceptionMessages::notEnoughArguments(5, info.Length())), i
nfo.GetIsolate()); | 77 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(s
tringArg); |
| 79 return; | |
| 80 } | |
| 81 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor", info.Holder(), info.GetIsolate()); | |
| 82 V8TRYCATCH_VOID(double, doubleArg, static_cast<double>(info[0]->NumberValue(
))); | |
| 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())); | |
| 91 V8TRYCATCH_VOID(Dictionary, optionalDictionaryArg, Dictionary(info[5], info.
GetIsolate())); | |
| 92 if (!optionalDictionaryArg.isUndefinedOrNull() && !optionalDictionaryArg.isO
bject()) { | |
| 93 throwTypeError(ExceptionMessages::failedToConstruct("TestInterfaceConstr
uctor", "parameter 6 ('optionalDictionaryArg') is not an object."), info.GetIsol
ate()); | |
| 94 return; | |
| 95 } | |
| 96 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, defaultUndefinedOpt
ionalStringArg, info[6]); | |
| 97 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, defaultNullStringOp
tionalStringArg, argumentOrNull(info, 7)); | |
| 98 V8TRYCATCH_VOID(TestInterfaceEmpty*, optionalTestInterfaceEmptyArg, V8TestIn
terfaceEmpty::hasInstance(info[8], info.GetIsolate(), worldType(info.GetIsolate(
))) ? V8TestInterfaceEmpty::toNative(v8::Handle<v8::Object>::Cast(info[8])) : 0)
; | |
| 99 V8TRYCATCH_VOID(Dictionary, defaultUndefinedOptionalDictionaryArg, Dictionar
y(info[9], info.GetIsolate())); | |
| 100 if (!defaultUndefinedOptionalDictionaryArg.isUndefinedOrNull() && !defaultUn
definedOptionalDictionaryArg.isObject()) { | |
| 101 throwTypeError(ExceptionMessages::failedToConstruct("TestInterfaceConstr
uctor", "parameter 10 ('defaultUndefinedOptionalDictionaryArg') is not an object
."), info.GetIsolate()); | |
| 102 return; | |
| 103 } | |
| 104 ExecutionContext* context = getExecutionContext(); | |
| 105 Document& document = *toDocument(getExecutionContext()); | |
| 106 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(con
text, document, doubleArg, stringArg, testInterfaceEmptyArg, dictionaryArg, sequ
enceStringArg, optionalDictionaryArg, defaultUndefinedOptionalStringArg, default
NullStringOptionalStringArg, optionalTestInterfaceEmptyArg, defaultUndefinedOpti
onalDictionaryArg, exceptionState); | |
| 107 v8::Handle<v8::Object> wrapper = info.Holder(); | 78 v8::Handle<v8::Object> wrapper = info.Holder(); |
| 108 if (exceptionState.throwIfNeeded()) | |
| 109 return; | |
| 110 | 79 |
| 111 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor>(impl.re
lease(), &V8TestInterfaceConstructor::wrapperTypeInfo, wrapper, info.GetIsolate(
), WrapperConfiguration::Dependent); | 80 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor2>(impl.r
elease(), &V8TestInterfaceConstructor2::wrapperTypeInfo, wrapper, info.GetIsolat
e(), WrapperConfiguration::Dependent); |
| 112 v8SetReturnValue(info, wrapper); | 81 v8SetReturnValue(info, wrapper); |
| 113 } | 82 } |
| 114 | 83 |
| 115 } // namespace TestInterfaceConstructorV8Internal | 84 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 85 { |
| 86 V8TRYCATCH_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceE
mpty::hasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8
TestInterfaceEmpty::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0); |
| 87 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, defaultUndefinedOpt
ionalStringArg, info[1]); |
| 88 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, defaultNullStringOp
tionalStringArg, argumentOrNull(info, 2)); |
| 89 V8TRYCATCH_VOID(Dictionary, defaultUndefinedOptionalDictionaryArg, Dictionar
y(info[3], info.GetIsolate())); |
| 90 if (!defaultUndefinedOptionalDictionaryArg.isUndefinedOrNull() && !defaultUn
definedOptionalDictionaryArg.isObject()) { |
| 91 throwTypeError(ExceptionMessages::failedToConstruct("TestInterfaceConstr
uctor2", "parameter 4 ('defaultUndefinedOptionalDictionaryArg') is not an object
."), info.GetIsolate()); |
| 92 return; |
| 93 } |
| 94 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(t
estInterfaceEmptyArg, defaultUndefinedOptionalStringArg, defaultNullStringOption
alStringArg, defaultUndefinedOptionalDictionaryArg); |
| 95 v8::Handle<v8::Object> wrapper = info.Holder(); |
| 116 | 96 |
| 117 void V8TestInterfaceConstructor::constructorCallback(const v8::FunctionCallbackI
nfo<v8::Value>& info) | 97 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor2>(impl.r
elease(), &V8TestInterfaceConstructor2::wrapperTypeInfo, wrapper, info.GetIsolat
e(), WrapperConfiguration::Dependent); |
| 98 v8SetReturnValue(info, wrapper); |
| 99 } |
| 100 |
| 101 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 102 { |
| 103 if (((info.Length() == 1))) { |
| 104 TestInterfaceConstructor2V8Internal::constructor1(info); |
| 105 return; |
| 106 } |
| 107 if (((info.Length() == 1) && (V8TestInterfaceEmpty::hasInstance(info[0], inf
o.GetIsolate(), worldType(info.GetIsolate())))) || ((info.Length() == 2) && (V8T
estInterfaceEmpty::hasInstance(info[0], info.GetIsolate(), worldType(info.GetIso
late())))) || ((info.Length() == 3) && (V8TestInterfaceEmpty::hasInstance(info[0
], info.GetIsolate(), worldType(info.GetIsolate())))) || ((info.Length() == 4) &
& (V8TestInterfaceEmpty::hasInstance(info[0], info.GetIsolate(), worldType(info.
GetIsolate()))))) { |
| 108 TestInterfaceConstructor2V8Internal::constructor2(info); |
| 109 return; |
| 110 } |
| 111 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor2", info.Holder(), info.GetIsolate()); |
| 112 if (UNLIKELY(info.Length() < 1)) { |
| 113 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
| 114 exceptionState.throwIfNeeded(); |
| 115 return; |
| 116 } |
| 117 exceptionState.throwTypeError("No matching constructor signature."); |
| 118 exceptionState.throwIfNeeded(); |
| 119 } |
| 120 |
| 121 } // namespace TestInterfaceConstructor2V8Internal |
| 122 |
| 123 void V8TestInterfaceConstructor2::constructorCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
| 118 { | 124 { |
| 119 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor"); | 125 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor"); |
| 120 UseCounter::count(activeDOMWindow(), UseCounter::TestFeature); | |
| 121 if (!info.IsConstructCall()) { | 126 if (!info.IsConstructCall()) { |
| 122 throwTypeError(ExceptionMessages::failedToConstruct("TestInterfaceConstr
uctor", "Please use the 'new' operator, this DOM object constructor cannot be ca
lled as a function."), info.GetIsolate()); | 127 throwTypeError(ExceptionMessages::failedToConstruct("TestInterfaceConstr
uctor2", "Please use the 'new' operator, this DOM object constructor cannot be c
alled as a function."), info.GetIsolate()); |
| 123 return; | 128 return; |
| 124 } | 129 } |
| 125 | 130 |
| 126 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) { | 131 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) { |
| 127 v8SetReturnValue(info, info.Holder()); | 132 v8SetReturnValue(info, info.Holder()); |
| 128 return; | 133 return; |
| 129 } | 134 } |
| 130 | 135 |
| 131 TestInterfaceConstructorV8Internal::constructor(info); | 136 TestInterfaceConstructor2V8Internal::constructor(info); |
| 132 } | 137 } |
| 133 | 138 |
| 134 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestInterfaceConstructorTempl
ate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, Wra
pperWorldType currentWorldType) | 139 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestInterfaceConstructor2Temp
late(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, Wr
apperWorldType currentWorldType) |
| 135 { | 140 { |
| 136 functionTemplate->ReadOnlyPrototype(); | 141 functionTemplate->ReadOnlyPrototype(); |
| 137 | 142 |
| 138 v8::Local<v8::Signature> defaultSignature; | 143 v8::Local<v8::Signature> defaultSignature; |
| 139 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestInterfaceConstructor", v8::Local<v8::FunctionTemplate>(), V8TestInterf
aceConstructor::internalFieldCount, | 144 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestInterfaceConstructor2", v8::Local<v8::FunctionTemplate>(), V8TestInter
faceConstructor2::internalFieldCount, |
| 140 0, 0, | 145 0, 0, |
| 141 0, 0, | 146 0, 0, |
| 142 0, 0, | 147 0, 0, |
| 143 isolate, currentWorldType); | 148 isolate, currentWorldType); |
| 144 functionTemplate->SetCallHandler(V8TestInterfaceConstructor::constructorCall
back); | 149 functionTemplate->SetCallHandler(V8TestInterfaceConstructor2::constructorCal
lback); |
| 145 functionTemplate->SetLength(5); | 150 functionTemplate->SetLength(1); |
| 146 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); | 151 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
| 147 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); | 152 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
| 148 | 153 |
| 149 // Custom toString template | 154 // Custom toString template |
| 150 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); | 155 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); |
| 151 return functionTemplate; | 156 return functionTemplate; |
| 152 } | 157 } |
| 153 | 158 |
| 154 v8::Handle<v8::FunctionTemplate> V8TestInterfaceConstructor::domTemplate(v8::Iso
late* isolate, WrapperWorldType currentWorldType) | 159 v8::Handle<v8::FunctionTemplate> V8TestInterfaceConstructor2::domTemplate(v8::Is
olate* isolate, WrapperWorldType currentWorldType) |
| 155 { | 160 { |
| 156 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 161 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
| 157 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); | 162 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); |
| 158 if (result != data->templateMap(currentWorldType).end()) | 163 if (result != data->templateMap(currentWorldType).end()) |
| 159 return result->value.newLocal(isolate); | 164 return result->value.newLocal(isolate); |
| 160 | 165 |
| 161 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); | 166 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); |
| 162 v8::EscapableHandleScope handleScope(isolate); | 167 v8::EscapableHandleScope handleScope(isolate); |
| 163 v8::Local<v8::FunctionTemplate> templ = | 168 v8::Local<v8::FunctionTemplate> templ = |
| 164 ConfigureV8TestInterfaceConstructorTemplate(data->rawDOMTemplate(&wrappe
rTypeInfo, currentWorldType), isolate, currentWorldType); | 169 ConfigureV8TestInterfaceConstructor2Template(data->rawDOMTemplate(&wrapp
erTypeInfo, currentWorldType), isolate, currentWorldType); |
| 165 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); | 170 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); |
| 166 return handleScope.Escape(templ); | 171 return handleScope.Escape(templ); |
| 167 } | 172 } |
| 168 | 173 |
| 169 bool V8TestInterfaceConstructor::hasInstance(v8::Handle<v8::Value> jsValue, v8::
Isolate* isolate, WrapperWorldType currentWorldType) | 174 bool V8TestInterfaceConstructor2::hasInstance(v8::Handle<v8::Value> jsValue, v8:
:Isolate* isolate, WrapperWorldType currentWorldType) |
| 170 { | 175 { |
| 171 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, currentWorldType); | 176 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, currentWorldType); |
| 172 } | 177 } |
| 173 | 178 |
| 174 bool V8TestInterfaceConstructor::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsV
alue, v8::Isolate* isolate) | 179 bool V8TestInterfaceConstructor2::hasInstanceInAnyWorld(v8::Handle<v8::Value> js
Value, v8::Isolate* isolate) |
| 175 { | 180 { |
| 176 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, MainWorld) | 181 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, MainWorld) |
| 177 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, IsolatedWorld) | 182 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, IsolatedWorld) |
| 178 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, WorkerWorld); | 183 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, WorkerWorld); |
| 179 } | 184 } |
| 180 | 185 |
| 181 v8::Handle<v8::Object> V8TestInterfaceConstructor::createWrapper(PassRefPtr<Test
InterfaceConstructor> impl, v8::Handle<v8::Object> creationContext, v8::Isolate*
isolate) | 186 v8::Handle<v8::Object> V8TestInterfaceConstructor2::createWrapper(PassRefPtr<Tes
tInterfaceConstructor2> impl, v8::Handle<v8::Object> creationContext, v8::Isolat
e* isolate) |
| 182 { | 187 { |
| 183 ASSERT(impl); | 188 ASSERT(impl); |
| 184 ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceConstructor>(impl.get()
, isolate)); | 189 ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceConstructor2>(impl.get(
), isolate)); |
| 185 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { | 190 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { |
| 186 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl.get()); | 191 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl.get()); |
| 187 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper
TypeInfo. These will both have | 192 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper
TypeInfo. These will both have |
| 188 // the same object de-ref functions, though, so use that as the basis of
the check. | 193 // the same object de-ref functions, though, so use that as the basis of
the check. |
| 189 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== wrapperTypeInfo.derefObjectFunction); | 194 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== wrapperTypeInfo.derefObjectFunction); |
| 190 } | 195 } |
| 191 | 196 |
| 192 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate); | 197 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate); |
| 193 if (UNLIKELY(wrapper.IsEmpty())) | 198 if (UNLIKELY(wrapper.IsEmpty())) |
| 194 return wrapper; | 199 return wrapper; |
| 195 | 200 |
| 196 installPerContextEnabledProperties(wrapper, impl.get(), isolate); | 201 installPerContextEnabledProperties(wrapper, impl.get(), isolate); |
| 197 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor>(impl, &
wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent); | 202 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor2>(impl,
&wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent); |
| 198 return wrapper; | 203 return wrapper; |
| 199 } | 204 } |
| 200 | 205 |
| 201 void V8TestInterfaceConstructor::derefObject(void* object) | 206 void V8TestInterfaceConstructor2::derefObject(void* object) |
| 202 { | 207 { |
| 203 fromInternalPointer(object)->deref(); | 208 fromInternalPointer(object)->deref(); |
| 204 } | 209 } |
| 205 | 210 |
| 206 template<> | 211 template<> |
| 207 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor* impl, v8::Handle<v8
::Object> creationContext, v8::Isolate* isolate) | 212 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor2* impl, v8::Handle<v
8::Object> creationContext, v8::Isolate* isolate) |
| 208 { | 213 { |
| 209 return toV8(impl, creationContext, isolate); | 214 return toV8(impl, creationContext, isolate); |
| 210 } | 215 } |
| 211 | 216 |
| 212 } // namespace WebCore | 217 } // namespace WebCore |
| OLD | NEW |