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 "config.h" | 7 #include "config.h" |
8 #include "V8TestObject.h" | 8 #include "V8TestObject.h" |
9 | 9 |
10 #include "bindings/core/v8/BindingSecurity.h" | 10 #include "bindings/core/v8/BindingSecurity.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 } | 77 } |
78 | 78 |
79 } // namespace blink | 79 } // namespace blink |
80 | 80 |
81 void webCoreInitializeScriptWrappableForInterface(blink::TestObject* object) | 81 void webCoreInitializeScriptWrappableForInterface(blink::TestObject* object) |
82 { | 82 { |
83 blink::initializeScriptWrappableForInterface(object); | 83 blink::initializeScriptWrappableForInterface(object); |
84 } | 84 } |
85 | 85 |
86 namespace blink { | 86 namespace blink { |
87 const WrapperTypeInfo V8TestObject::wrapperTypeInfo = { gin::kEmbedderBlink, V8T
estObject::domTemplate, V8TestObject::derefObject, 0, 0, 0, V8TestObject::instal
lConditionallyEnabledMethods, 0, WrapperTypeObjectPrototype, RefCountedObject }; | 87 const WrapperTypeInfo V8TestObject::wrapperTypeInfo = { gin::kEmbedderBlink, V8T
estObject::domTemplate, V8TestObject::derefObject, 0, 0, 0, V8TestObject::instal
lPerContextEnabledMethods, 0, WrapperTypeObjectPrototype, RefCountedObject }; |
88 | 88 |
89 namespace TestObjectV8Internal { | 89 namespace TestObjectV8Internal { |
90 | 90 |
91 template <typename T> void V8_USE(T) { } | 91 template <typename T> void V8_USE(T) { } |
92 | 92 |
93 static void stringifierAttributeAttributeGetter(const v8::PropertyCallbackInfo<v
8::Value>& info) | 93 static void stringifierAttributeAttributeGetter(const v8::PropertyCallbackInfo<v
8::Value>& info) |
94 { | 94 { |
95 v8::Handle<v8::Object> holder = info.Holder(); | 95 v8::Handle<v8::Object> holder = info.Holder(); |
96 TestObject* impl = V8TestObject::toNative(holder); | 96 TestObject* impl = V8TestObject::toNative(holder); |
97 v8SetReturnValueString(info, impl->stringifierAttribute(), info.GetIsolate()
); | 97 v8SetReturnValueString(info, impl->stringifierAttribute(), info.GetIsolate()
); |
(...skipping 10512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10610 v8::Handle<v8::Object> V8TestObject::findInstanceInPrototypeChain(v8::Handle<v8:
:Value> v8Value, v8::Isolate* isolate) | 10610 v8::Handle<v8::Object> V8TestObject::findInstanceInPrototypeChain(v8::Handle<v8:
:Value> v8Value, v8::Isolate* isolate) |
10611 { | 10611 { |
10612 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); | 10612 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); |
10613 } | 10613 } |
10614 | 10614 |
10615 TestObject* V8TestObject::toNativeWithTypeCheck(v8::Isolate* isolate, v8::Handle
<v8::Value> value) | 10615 TestObject* V8TestObject::toNativeWithTypeCheck(v8::Isolate* isolate, v8::Handle
<v8::Value> value) |
10616 { | 10616 { |
10617 return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Obje
ct>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) :
0; | 10617 return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Obje
ct>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) :
0; |
10618 } | 10618 } |
10619 | 10619 |
10620 void V8TestObject::installConditionallyEnabledProperties(v8::Handle<v8::Object>
instanceTemplate, v8::Isolate* isolate) | 10620 void V8TestObject::installPerContextEnabledProperties(v8::Handle<v8::Object> ins
tanceTemplate, TestObject* impl, v8::Isolate* isolate) |
10621 { | 10621 { |
10622 v8::Local<v8::Object> prototypeTemplate = v8::Local<v8::Object>::Cast(instan
ceTemplate->GetPrototype()); | 10622 v8::Local<v8::Object> prototypeTemplate = v8::Local<v8::Object>::Cast(instan
ceTemplate->GetPrototype()); |
10623 ExecutionContext* context = toExecutionContext(prototypeTemplate->CreationCo
ntext()); | 10623 if (ContextFeatures::featureNameEnabled(impl->document())) { |
10624 | |
10625 if (context && context->isDocument() && ContextFeatures::featureNameEnabled(
toDocument(context))) { | |
10626 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ | 10624 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ |
10627 {"perContextEnabledLongAttribute", TestObjectV8Internal::perContextEnabl
edLongAttributeAttributeGetterCallback, TestObjectV8Internal::perContextEnabledL
ongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8:
:DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::Exp
osedToAllScripts, V8DOMConfiguration::OnInstance}; | 10625 {"perContextEnabledLongAttribute", TestObjectV8Internal::perContextEnabl
edLongAttributeAttributeGetterCallback, TestObjectV8Internal::perContextEnabledL
ongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8:
:DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::Exp
osedToAllScripts, V8DOMConfiguration::OnInstance}; |
10628 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate); | 10626 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate); |
10629 } | 10627 } |
10630 if (context && context->isDocument() && ContextFeatures::featureNameEnabled(
toDocument(context))) { | 10628 if (ContextFeatures::featureNameEnabled(impl->document())) { |
10631 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ | 10629 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ |
10632 {"perContextEnabledRuntimeEnabledLongAttribute", TestObjectV8Internal::p
erContextEnabledRuntimeEnabledLongAttributeAttributeGetterCallback, TestObjectV8
Internal::perContextEnabledRuntimeEnabledLongAttributeAttributeSetterCallback, 0
, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAtt
ribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::
OnInstance}; | 10630 {"perContextEnabledRuntimeEnabledLongAttribute", TestObjectV8Internal::p
erContextEnabledRuntimeEnabledLongAttributeAttributeGetterCallback, TestObjectV8
Internal::perContextEnabledRuntimeEnabledLongAttributeAttributeSetterCallback, 0
, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAtt
ribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::
OnInstance}; |
10633 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate); | 10631 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate); |
10634 } | 10632 } |
10635 } | 10633 } |
10636 | 10634 |
10637 void V8TestObject::installConditionallyEnabledMethods(v8::Handle<v8::Object> pro
totypeTemplate, v8::Isolate* isolate) | 10635 void V8TestObject::installPerContextEnabledMethods(v8::Handle<v8::Object> protot
ypeTemplate, v8::Isolate* isolate) |
10638 { | 10636 { |
10639 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domT
emplate(isolate)); | 10637 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domT
emplate(isolate)); |
| 10638 |
10640 ExecutionContext* context = toExecutionContext(prototypeTemplate->CreationCo
ntext()); | 10639 ExecutionContext* context = toExecutionContext(prototypeTemplate->CreationCo
ntext()); |
10641 | 10640 if (context && context->isDocument() && ContextFeatures::featureNameEnabled(
toDocument(context))) |
10642 if (context && context->isDocument() && ContextFeatures::featureNameEnabled(
toDocument(context))) { | |
10643 prototypeTemplate->Set(v8AtomicString(isolate, "perContextEnabledVoidMet
hod"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::perContextEnable
dVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0)->GetFunction()); | 10641 prototypeTemplate->Set(v8AtomicString(isolate, "perContextEnabledVoidMet
hod"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::perContextEnable
dVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0)->GetFunction()); |
10644 } | |
10645 } | 10642 } |
10646 | 10643 |
10647 v8::Handle<v8::Object> wrap(TestObject* impl, v8::Handle<v8::Object> creationCon
text, v8::Isolate* isolate) | 10644 v8::Handle<v8::Object> wrap(TestObject* impl, v8::Handle<v8::Object> creationCon
text, v8::Isolate* isolate) |
10648 { | 10645 { |
10649 ASSERT(impl); | 10646 ASSERT(impl); |
10650 ASSERT(!DOMDataStore::containsWrapper<V8TestObject>(impl, isolate)); | 10647 ASSERT(!DOMDataStore::containsWrapper<V8TestObject>(impl, isolate)); |
10651 return V8TestObject::createWrapper(impl, creationContext, isolate); | 10648 return V8TestObject::createWrapper(impl, creationContext, isolate); |
10652 } | 10649 } |
10653 | 10650 |
10654 v8::Handle<v8::Object> V8TestObject::createWrapper(PassRefPtr<TestObject> impl,
v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) | 10651 v8::Handle<v8::Object> V8TestObject::createWrapper(PassRefPtr<TestObject> impl,
v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
10655 { | 10652 { |
10656 ASSERT(impl); | 10653 ASSERT(impl); |
10657 ASSERT(!DOMDataStore::containsWrapper<V8TestObject>(impl.get(), isolate)); | 10654 ASSERT(!DOMDataStore::containsWrapper<V8TestObject>(impl.get(), isolate)); |
10658 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { | 10655 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { |
10659 const WrapperTypeInfo* actualInfo = ScriptWrappable::fromObject(impl.get
())->typeInfo(); | 10656 const WrapperTypeInfo* actualInfo = ScriptWrappable::fromObject(impl.get
())->typeInfo(); |
10660 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper
TypeInfo. These will both have | 10657 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper
TypeInfo. These will both have |
10661 // the same object de-ref functions, though, so use that as the basis of
the check. | 10658 // the same object de-ref functions, though, so use that as the basis of
the check. |
10662 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== wrapperTypeInfo.derefObjectFunction); | 10659 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== wrapperTypeInfo.derefObjectFunction); |
10663 } | 10660 } |
10664 | 10661 |
10665 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate); | 10662 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate); |
10666 if (UNLIKELY(wrapper.IsEmpty())) | 10663 if (UNLIKELY(wrapper.IsEmpty())) |
10667 return wrapper; | 10664 return wrapper; |
10668 | 10665 |
10669 installConditionallyEnabledProperties(wrapper, isolate); | 10666 installPerContextEnabledProperties(wrapper, impl.get(), isolate); |
10670 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl, &wrapperTypeInf
o, wrapper, isolate, WrapperConfiguration::Independent); | 10667 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl, &wrapperTypeInf
o, wrapper, isolate, WrapperConfiguration::Independent); |
10671 return wrapper; | 10668 return wrapper; |
10672 } | 10669 } |
10673 | 10670 |
10674 void V8TestObject::derefObject(void* object) | 10671 void V8TestObject::derefObject(void* object) |
10675 { | 10672 { |
10676 fromInternalPointer(object)->deref(); | 10673 fromInternalPointer(object)->deref(); |
10677 } | 10674 } |
10678 | 10675 |
10679 template<> | 10676 template<> |
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11203 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { | 11200 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { |
11204 // FIXME: We should support exceptions other than DOM exceptions. | 11201 // FIXME: We should support exceptions other than DOM exceptions. |
11205 RELEASE_ASSERT_NOT_REACHED(); | 11202 RELEASE_ASSERT_NOT_REACHED(); |
11206 } | 11203 } |
11207 return false; | 11204 return false; |
11208 } | 11205 } |
11209 return true; | 11206 return true; |
11210 } | 11207 } |
11211 | 11208 |
11212 } // namespace blink | 11209 } // namespace blink |
OLD | NEW |