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 2859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2870 impl->setNotEnumerableLongAttribute(cppValue); | 2870 impl->setNotEnumerableLongAttribute(cppValue); |
2871 } | 2871 } |
2872 | 2872 |
2873 static void notEnumerableLongAttributeAttributeSetterCallback(v8::Local<v8::Name
>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | 2873 static void notEnumerableLongAttributeAttributeSetterCallback(v8::Local<v8::Name
>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
2874 { | 2874 { |
2875 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | 2875 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
2876 TestObjectV8Internal::notEnumerableLongAttributeAttributeSetter(v8Value, inf
o); | 2876 TestObjectV8Internal::notEnumerableLongAttributeAttributeSetter(v8Value, inf
o); |
2877 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 2877 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
2878 } | 2878 } |
2879 | 2879 |
2880 static void perContextEnabledLongAttributeAttributeGetter(const v8::PropertyCall
backInfo<v8::Value>& info) | |
2881 { | |
2882 v8::Local<v8::Object> holder = info.Holder(); | |
2883 TestObject* impl = V8TestObject::toImpl(holder); | |
2884 v8SetReturnValueInt(info, impl->perContextEnabledLongAttribute()); | |
2885 } | |
2886 | |
2887 static void perContextEnabledLongAttributeAttributeGetterCallback(v8::Local<v8::
Name>, const v8::PropertyCallbackInfo<v8::Value>& info) | |
2888 { | |
2889 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | |
2890 TestObjectV8Internal::perContextEnabledLongAttributeAttributeGetter(info); | |
2891 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
2892 } | |
2893 | |
2894 static void perContextEnabledLongAttributeAttributeSetter(v8::Local<v8::Value> v
8Value, const v8::PropertyCallbackInfo<void>& info) | |
2895 { | |
2896 v8::Local<v8::Object> holder = info.Holder(); | |
2897 ExceptionState exceptionState(ExceptionState::SetterContext, "perContextEnab
ledLongAttribute", "TestObject", holder, info.GetIsolate()); | |
2898 TestObject* impl = V8TestObject::toImpl(holder); | |
2899 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); | |
2900 if (exceptionState.throwIfNeeded()) | |
2901 return; | |
2902 impl->setPerContextEnabledLongAttribute(cppValue); | |
2903 } | |
2904 | |
2905 static void perContextEnabledLongAttributeAttributeSetterCallback(v8::Local<v8::
Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | |
2906 { | |
2907 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | |
2908 TestObjectV8Internal::perContextEnabledLongAttributeAttributeSetter(v8Value,
info); | |
2909 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
2910 } | |
2911 | |
2912 static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetter(c
onst v8::PropertyCallbackInfo<v8::Value>& info) | 2880 static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetter(c
onst v8::PropertyCallbackInfo<v8::Value>& info) |
2913 { | 2881 { |
2914 v8::Local<v8::Object> holder = info.Holder(); | 2882 v8::Local<v8::Object> holder = info.Holder(); |
2915 TestObject* impl = V8TestObject::toImpl(holder); | 2883 TestObject* impl = V8TestObject::toImpl(holder); |
2916 RefPtr<TestInterfaceEmpty> cppValue(impl->perWorldBindingsReadonlyTestInterf
aceEmptyAttribute()); | 2884 RefPtr<TestInterfaceEmpty> cppValue(impl->perWorldBindingsReadonlyTestInterf
aceEmptyAttribute()); |
2917 if (cppValue && DOMDataStore::setReturnValue(info.GetReturnValue(), cppValue
.get())) | 2885 if (cppValue && DOMDataStore::setReturnValue(info.GetReturnValue(), cppValue
.get())) |
2918 return; | 2886 return; |
2919 v8::Local<v8::Value> v8Value(toV8(cppValue.get(), holder, info.GetIsolate())
); | 2887 v8::Local<v8::Value> v8Value(toV8(cppValue.get(), holder, info.GetIsolate())
); |
2920 if (!v8Value.IsEmpty()) { | 2888 if (!v8Value.IsEmpty()) { |
2921 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, v8AtomicString(
info.GetIsolate(), "perWorldBindingsReadonlyTestInterfaceEmptyAttribute"), v8Val
ue); | 2889 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, v8AtomicString(
info.GetIsolate(), "perWorldBindingsReadonlyTestInterfaceEmptyAttribute"), v8Val
ue); |
(...skipping 1614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4536 impl->setRuntimeEnabledLongAttribute(cppValue); | 4504 impl->setRuntimeEnabledLongAttribute(cppValue); |
4537 } | 4505 } |
4538 | 4506 |
4539 static void runtimeEnabledLongAttributeAttributeSetterCallback(v8::Local<v8::Nam
e>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | 4507 static void runtimeEnabledLongAttributeAttributeSetterCallback(v8::Local<v8::Nam
e>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
4540 { | 4508 { |
4541 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | 4509 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
4542 TestObjectV8Internal::runtimeEnabledLongAttributeAttributeSetter(v8Value, in
fo); | 4510 TestObjectV8Internal::runtimeEnabledLongAttributeAttributeSetter(v8Value, in
fo); |
4543 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 4511 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
4544 } | 4512 } |
4545 | 4513 |
4546 static void perContextEnabledRuntimeEnabledLongAttributeAttributeGetter(const v8
::PropertyCallbackInfo<v8::Value>& info) | |
4547 { | |
4548 v8::Local<v8::Object> holder = info.Holder(); | |
4549 TestObject* impl = V8TestObject::toImpl(holder); | |
4550 v8SetReturnValueInt(info, impl->perContextEnabledRuntimeEnabledLongAttribute
()); | |
4551 } | |
4552 | |
4553 static void perContextEnabledRuntimeEnabledLongAttributeAttributeGetterCallback(
v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) | |
4554 { | |
4555 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | |
4556 TestObjectV8Internal::perContextEnabledRuntimeEnabledLongAttributeAttributeG
etter(info); | |
4557 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
4558 } | |
4559 | |
4560 static void perContextEnabledRuntimeEnabledLongAttributeAttributeSetter(v8::Loca
l<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | |
4561 { | |
4562 v8::Local<v8::Object> holder = info.Holder(); | |
4563 ExceptionState exceptionState(ExceptionState::SetterContext, "perContextEnab
ledRuntimeEnabledLongAttribute", "TestObject", holder, info.GetIsolate()); | |
4564 TestObject* impl = V8TestObject::toImpl(holder); | |
4565 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); | |
4566 if (exceptionState.throwIfNeeded()) | |
4567 return; | |
4568 impl->setPerContextEnabledRuntimeEnabledLongAttribute(cppValue); | |
4569 } | |
4570 | |
4571 static void perContextEnabledRuntimeEnabledLongAttributeAttributeSetterCallback(
v8::Local<v8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInf
o<void>& info) | |
4572 { | |
4573 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | |
4574 TestObjectV8Internal::perContextEnabledRuntimeEnabledLongAttributeAttributeS
etter(v8Value, info); | |
4575 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
4576 } | |
4577 | |
4578 #if ENABLE(CONDITION) | 4514 #if ENABLE(CONDITION) |
4579 static void conditionalRuntimeEnabledLongAttributeAttributeGetter(const v8::Prop
ertyCallbackInfo<v8::Value>& info) | 4515 static void conditionalRuntimeEnabledLongAttributeAttributeGetter(const v8::Prop
ertyCallbackInfo<v8::Value>& info) |
4580 { | 4516 { |
4581 v8::Local<v8::Object> holder = info.Holder(); | 4517 v8::Local<v8::Object> holder = info.Holder(); |
4582 TestObject* impl = V8TestObject::toImpl(holder); | 4518 TestObject* impl = V8TestObject::toImpl(holder); |
4583 v8SetReturnValueInt(info, impl->conditionalRuntimeEnabledLongAttribute()); | 4519 v8SetReturnValueInt(info, impl->conditionalRuntimeEnabledLongAttribute()); |
4584 } | 4520 } |
4585 #endif // ENABLE(CONDITION) | 4521 #endif // ENABLE(CONDITION) |
4586 | 4522 |
4587 #if ENABLE(CONDITION) | 4523 #if ENABLE(CONDITION) |
(...skipping 6072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10660 impl->notEnumerableVoidMethod(); | 10596 impl->notEnumerableVoidMethod(); |
10661 } | 10597 } |
10662 | 10598 |
10663 static void notEnumerableVoidMethodMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) | 10599 static void notEnumerableVoidMethodMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) |
10664 { | 10600 { |
10665 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); | 10601 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
10666 TestObjectV8Internal::notEnumerableVoidMethodMethod(info); | 10602 TestObjectV8Internal::notEnumerableVoidMethodMethod(info); |
10667 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 10603 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
10668 } | 10604 } |
10669 | 10605 |
10670 static void perContextEnabledVoidMethodMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) | |
10671 { | |
10672 TestObject* impl = V8TestObject::toImpl(info.Holder()); | |
10673 impl->perContextEnabledVoidMethod(); | |
10674 } | |
10675 | |
10676 static void perContextEnabledVoidMethodMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) | |
10677 { | |
10678 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); | |
10679 TestObjectV8Internal::perContextEnabledVoidMethodMethod(info); | |
10680 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
10681 } | |
10682 | |
10683 static void perWorldBindingsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::
Value>& info) | 10606 static void perWorldBindingsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::
Value>& info) |
10684 { | 10607 { |
10685 TestObject* impl = V8TestObject::toImpl(info.Holder()); | 10608 TestObject* impl = V8TestObject::toImpl(info.Holder()); |
10686 impl->perWorldBindingsVoidMethod(); | 10609 impl->perWorldBindingsVoidMethod(); |
10687 } | 10610 } |
10688 | 10611 |
10689 static void perWorldBindingsVoidMethodMethodCallback(const v8::FunctionCallbackI
nfo<v8::Value>& info) | 10612 static void perWorldBindingsVoidMethodMethodCallback(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
10690 { | 10613 { |
10691 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); | 10614 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
10692 TestObjectV8Internal::perWorldBindingsVoidMethodMethod(info); | 10615 TestObjectV8Internal::perWorldBindingsVoidMethodMethod(info); |
(...skipping 2100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12793 v8::Local<v8::Object> V8TestObject::findInstanceInPrototypeChain(v8::Local<v8::V
alue> v8Value, v8::Isolate* isolate) | 12716 v8::Local<v8::Object> V8TestObject::findInstanceInPrototypeChain(v8::Local<v8::V
alue> v8Value, v8::Isolate* isolate) |
12794 { | 12717 { |
12795 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); | 12718 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); |
12796 } | 12719 } |
12797 | 12720 |
12798 TestObject* V8TestObject::toImplWithTypeCheck(v8::Isolate* isolate, v8::Local<v8
::Value> value) | 12721 TestObject* V8TestObject::toImplWithTypeCheck(v8::Isolate* isolate, v8::Local<v8
::Value> value) |
12799 { | 12722 { |
12800 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : 0; | 12723 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : 0; |
12801 } | 12724 } |
12802 | 12725 |
12803 void V8TestObject::installConditionallyEnabledProperties(v8::Local<v8::Object> i
nstanceObject, v8::Isolate* isolate) | |
12804 { | |
12805 v8::Local<v8::Object> prototypeObject = v8::Local<v8::Object>::Cast(instance
Object->GetPrototype()); | |
12806 ExecutionContext* context = toExecutionContext(prototypeObject->CreationCont
ext()); | |
12807 | |
12808 if (context && context->isDocument() && ContextFeatures::featureNameEnabled(
toDocument(context))) { | |
12809 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration = {"perContextEnabledLongAttribute", TestObjectV8Internal::perContextEnab
ledLongAttributeAttributeGetterCallback, TestObjectV8Internal::perContextEnabled
LongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8
::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::Ex
posedToAllScripts, V8DOMConfiguration::OnInstance}; | |
12810 V8DOMConfiguration::installAttribute(isolate, instanceObject, prototypeO
bject, attributeConfiguration); | |
12811 } | |
12812 if (context && context->isDocument() && ContextFeatures::featureNameEnabled(
toDocument(context))) { | |
12813 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration = {"perContextEnabledRuntimeEnabledLongAttribute", TestObjectV8Internal::
perContextEnabledRuntimeEnabledLongAttributeAttributeGetterCallback, TestObjectV
8Internal::perContextEnabledRuntimeEnabledLongAttributeAttributeSetterCallback,
0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAt
tribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration:
:OnInstance}; | |
12814 V8DOMConfiguration::installAttribute(isolate, instanceObject, prototypeO
bject, attributeConfiguration); | |
12815 } | |
12816 } | |
12817 | |
12818 void V8TestObject::preparePrototypeObject(v8::Isolate* isolate, v8::Local<v8::Ob
ject> prototypeObject) | 12726 void V8TestObject::preparePrototypeObject(v8::Isolate* isolate, v8::Local<v8::Ob
ject> prototypeObject) |
12819 { | 12727 { |
12820 v8::Local<v8::Context> v8Context(prototypeObject->CreationContext()); | 12728 v8::Local<v8::Context> v8Context(prototypeObject->CreationContext()); |
12821 v8::Local<v8::Name> unscopablesSymbol(v8::Symbol::GetUnscopables(isolate)); | 12729 v8::Local<v8::Name> unscopablesSymbol(v8::Symbol::GetUnscopables(isolate)); |
12822 v8::Local<v8::Object> unscopeables; | 12730 v8::Local<v8::Object> unscopeables; |
12823 if (v8CallBoolean(prototypeObject->HasOwnProperty(v8Context, unscopablesSymb
ol))) | 12731 if (v8CallBoolean(prototypeObject->HasOwnProperty(v8Context, unscopablesSymb
ol))) |
12824 unscopeables = prototypeObject->Get(v8Context, unscopablesSymbol).ToLoca
lChecked().As<v8::Object>(); | 12732 unscopeables = prototypeObject->Get(v8Context, unscopablesSymbol).ToLoca
lChecked().As<v8::Object>(); |
12825 else | 12733 else |
12826 unscopeables = v8::Object::New(isolate); | 12734 unscopeables = v8::Object::New(isolate); |
12827 unscopeables->ForceSet(v8Context, v8AtomicString(isolate, "unscopeableLongAt
tribute"), v8::True(isolate)).FromJust(); | 12735 unscopeables->ForceSet(v8Context, v8AtomicString(isolate, "unscopeableLongAt
tribute"), v8::True(isolate)).FromJust(); |
12828 unscopeables->ForceSet(v8Context, v8AtomicString(isolate, "unscopeableVoidMe
thod"), v8::True(isolate)).FromJust(); | 12736 unscopeables->ForceSet(v8Context, v8AtomicString(isolate, "unscopeableVoidMe
thod"), v8::True(isolate)).FromJust(); |
12829 prototypeObject->ForceSet(v8Context, unscopablesSymbol, unscopeables).FromJu
st(); | 12737 prototypeObject->ForceSet(v8Context, unscopablesSymbol, unscopeables).FromJu
st(); |
12830 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domT
emplate(isolate)); | |
12831 ExecutionContext* context = toExecutionContext(prototypeObject->CreationCont
ext()); | |
12832 ASSERT(context); | |
12833 if (context && context->isDocument() && ContextFeatures::featureNameEnabled(
toDocument(context))) { | |
12834 prototypeObject->Set(v8AtomicString(isolate, "perContextEnabledVoidMetho
d"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::perContextEnabledV
oidMethodMethodCallback, v8Undefined(), defaultSignature, 0)->GetFunction(isolat
e->GetCurrentContext()).ToLocalChecked()); | |
12835 } | |
12836 } | 12738 } |
12837 | 12739 |
12838 void V8TestObject::refObject(ScriptWrappable* scriptWrappable) | 12740 void V8TestObject::refObject(ScriptWrappable* scriptWrappable) |
12839 { | 12741 { |
12840 scriptWrappable->toImpl<TestObject>()->ref(); | 12742 scriptWrappable->toImpl<TestObject>()->ref(); |
12841 } | 12743 } |
12842 | 12744 |
12843 void V8TestObject::derefObject(ScriptWrappable* scriptWrappable) | 12745 void V8TestObject::derefObject(ScriptWrappable* scriptWrappable) |
12844 { | 12746 { |
12845 scriptWrappable->toImpl<TestObject>()->deref(); | 12747 scriptWrappable->toImpl<TestObject>()->deref(); |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13328 return false; | 13230 return false; |
13329 | 13231 |
13330 ScriptState::Scope scope(scriptState); | 13232 ScriptState::Scope scope(scriptState); |
13331 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); | 13233 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); |
13332 | 13234 |
13333 ExceptionState exceptionState(ExceptionState::SetterContext, "enumForPrivate
Script", "TestObject", scriptState->context()->Global(), scriptState->isolate())
; | 13235 ExceptionState exceptionState(ExceptionState::SetterContext, "enumForPrivate
Script", "TestObject", scriptState->context()->Global(), scriptState->isolate())
; |
13334 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn
UserScript, "TestObject", "enumForPrivateScript", holder, v8String(scriptState->
isolate(), cppValue)); | 13236 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn
UserScript, "TestObject", "enumForPrivateScript", holder, v8String(scriptState->
isolate(), cppValue)); |
13335 } | 13237 } |
13336 | 13238 |
13337 } // namespace blink | 13239 } // namespace blink |
OLD | NEW |