| 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 "V8TestInterfaceCheckSecurity.h" | 7 #include "V8TestInterfaceCheckSecurity.h" |
| 8 | 8 |
| 9 #include "bindings/core/v8/BindingSecurity.h" | 9 #include "bindings/core/v8/BindingSecurity.h" |
| 10 #include "bindings/core/v8/ExceptionState.h" | 10 #include "bindings/core/v8/ExceptionState.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in | 31 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in |
| 32 // bindings/core/v8/ScriptWrappable.h. | 32 // bindings/core/v8/ScriptWrappable.h. |
| 33 const WrapperTypeInfo& TestInterfaceCheckSecurity::s_wrapperTypeInfo = V8TestInt
erfaceCheckSecurity::wrapperTypeInfo; | 33 const WrapperTypeInfo& TestInterfaceCheckSecurity::s_wrapperTypeInfo = V8TestInt
erfaceCheckSecurity::wrapperTypeInfo; |
| 34 | 34 |
| 35 namespace TestInterfaceCheckSecurityV8Internal { | 35 namespace TestInterfaceCheckSecurityV8Internal { |
| 36 | 36 |
| 37 static void readonlyLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<
v8::Value>& info) | 37 static void readonlyLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<
v8::Value>& info) |
| 38 { | 38 { |
| 39 v8::Local<v8::Object> holder = info.Holder(); | 39 v8::Local<v8::Object> holder = info.Holder(); |
| 40 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); | 40 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); |
| 41 ExceptionState exceptionState(ExceptionState::GetterContext, "readonlyLongAt
tribute", "TestInterfaceCheckSecurity", holder, info.GetIsolate()); | |
| 42 if (!BindingSecurity::shouldAllowAccessTo(info.GetIsolate(), callingDOMWindo
w(info.GetIsolate()), impl, exceptionState)) { | |
| 43 v8SetReturnValueNull(info); | |
| 44 exceptionState.throwIfNeeded(); | |
| 45 return; | |
| 46 } | |
| 47 v8SetReturnValueInt(info, impl->readonlyLongAttribute()); | 41 v8SetReturnValueInt(info, impl->readonlyLongAttribute()); |
| 48 } | 42 } |
| 49 | 43 |
| 50 static void readonlyLongAttributeAttributeGetterCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) | 44 static void readonlyLongAttributeAttributeGetterCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
| 51 { | 45 { |
| 52 TestInterfaceCheckSecurityV8Internal::readonlyLongAttributeAttributeGetter(i
nfo); | 46 TestInterfaceCheckSecurityV8Internal::readonlyLongAttributeAttributeGetter(i
nfo); |
| 53 } | 47 } |
| 54 | 48 |
| 55 static void longAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Valu
e>& info) | 49 static void longAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
| 56 { | 50 { |
| 57 v8::Local<v8::Object> holder = info.Holder(); | 51 v8::Local<v8::Object> holder = info.Holder(); |
| 58 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); | 52 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); |
| 59 ExceptionState exceptionState(ExceptionState::GetterContext, "longAttribute"
, "TestInterfaceCheckSecurity", holder, info.GetIsolate()); | |
| 60 if (!BindingSecurity::shouldAllowAccessTo(info.GetIsolate(), callingDOMWindo
w(info.GetIsolate()), impl, exceptionState)) { | |
| 61 v8SetReturnValueNull(info); | |
| 62 exceptionState.throwIfNeeded(); | |
| 63 return; | |
| 64 } | |
| 65 v8SetReturnValueInt(info, impl->longAttribute()); | 53 v8SetReturnValueInt(info, impl->longAttribute()); |
| 66 } | 54 } |
| 67 | 55 |
| 68 static void longAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) | 56 static void longAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) |
| 69 { | 57 { |
| 70 TestInterfaceCheckSecurityV8Internal::longAttributeAttributeGetter(info); | 58 TestInterfaceCheckSecurityV8Internal::longAttributeAttributeGetter(info); |
| 71 } | 59 } |
| 72 | 60 |
| 73 static void longAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8:
:FunctionCallbackInfo<v8::Value>& info) | 61 static void longAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8:
:FunctionCallbackInfo<v8::Value>& info) |
| 74 { | 62 { |
| 75 v8::Local<v8::Object> holder = info.Holder(); | 63 v8::Local<v8::Object> holder = info.Holder(); |
| 76 ExceptionState exceptionState(ExceptionState::SetterContext, "longAttribute"
, "TestInterfaceCheckSecurity", holder, info.GetIsolate()); | 64 ExceptionState exceptionState(ExceptionState::SetterContext, "longAttribute"
, "TestInterfaceCheckSecurity", holder, info.GetIsolate()); |
| 77 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); | 65 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); |
| 78 if (!BindingSecurity::shouldAllowAccessTo(info.GetIsolate(), callingDOMWindo
w(info.GetIsolate()), impl, exceptionState)) { | |
| 79 v8SetReturnValue(info, v8Value); | |
| 80 exceptionState.throwIfNeeded(); | |
| 81 return; | |
| 82 } | |
| 83 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); | 66 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); |
| 84 if (exceptionState.throwIfNeeded()) | 67 if (exceptionState.throwIfNeeded()) |
| 85 return; | 68 return; |
| 86 impl->setLongAttribute(cppValue); | 69 impl->setLongAttribute(cppValue); |
| 87 } | 70 } |
| 88 | 71 |
| 89 static void longAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) | 72 static void longAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) |
| 90 { | 73 { |
| 91 v8::Local<v8::Value> v8Value = info[0]; | 74 v8::Local<v8::Value> v8Value = info[0]; |
| 92 TestInterfaceCheckSecurityV8Internal::longAttributeAttributeSetter(v8Value,
info); | 75 TestInterfaceCheckSecurityV8Internal::longAttributeAttributeSetter(v8Value,
info); |
| 93 } | 76 } |
| 94 | 77 |
| 95 static void doNotCheckSecurityLongAttributeAttributeGetter(const v8::FunctionCal
lbackInfo<v8::Value>& info) | 78 static void doNotCheckSecurityLongAttributeAttributeGetter(const v8::PropertyCal
lbackInfo<v8::Value>& info) |
| 96 { | 79 { |
| 97 v8::Local<v8::Object> holder = info.Holder(); | 80 v8::Local<v8::Object> holder = info.Holder(); |
| 98 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); | 81 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); |
| 99 v8SetReturnValueInt(info, impl->doNotCheckSecurityLongAttribute()); | 82 v8SetReturnValueInt(info, impl->doNotCheckSecurityLongAttribute()); |
| 100 } | 83 } |
| 101 | 84 |
| 102 static void doNotCheckSecurityLongAttributeAttributeGetterCallback(const v8::Fun
ctionCallbackInfo<v8::Value>& info) | 85 static void doNotCheckSecurityLongAttributeAttributeGetterCallback(v8::Local<v8:
:Name>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 103 { | 86 { |
| 104 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttribu
teGetter(info); | 87 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttribu
teGetter(info); |
| 105 } | 88 } |
| 106 | 89 |
| 107 static void doNotCheckSecurityLongAttributeAttributeSetter(v8::Local<v8::Value>
v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) | 90 static void doNotCheckSecurityLongAttributeAttributeSetter(v8::Local<v8::Value>
v8Value, const v8::PropertyCallbackInfo<void>& info) |
| 108 { | 91 { |
| 109 v8::Local<v8::Object> holder = info.Holder(); | 92 v8::Local<v8::Object> holder = info.Holder(); |
| 110 ExceptionState exceptionState(ExceptionState::SetterContext, "doNotCheckSecu
rityLongAttribute", "TestInterfaceCheckSecurity", holder, info.GetIsolate()); | 93 ExceptionState exceptionState(ExceptionState::SetterContext, "doNotCheckSecu
rityLongAttribute", "TestInterfaceCheckSecurity", holder, info.GetIsolate()); |
| 111 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); | 94 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); |
| 112 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); | 95 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); |
| 113 if (exceptionState.throwIfNeeded()) | 96 if (exceptionState.throwIfNeeded()) |
| 114 return; | 97 return; |
| 115 impl->setDoNotCheckSecurityLongAttribute(cppValue); | 98 impl->setDoNotCheckSecurityLongAttribute(cppValue); |
| 116 } | 99 } |
| 117 | 100 |
| 118 static void doNotCheckSecurityLongAttributeAttributeSetterCallback(const v8::Fun
ctionCallbackInfo<v8::Value>& info) | 101 static void doNotCheckSecurityLongAttributeAttributeSetterCallback(v8::Local<v8:
:Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info
) |
| 119 { | 102 { |
| 120 v8::Local<v8::Value> v8Value = info[0]; | |
| 121 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttribu
teSetter(v8Value, info); | 103 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttribu
teSetter(v8Value, info); |
| 122 } | 104 } |
| 123 | 105 |
| 124 static void doNotCheckSecurityReadonlyLongAttributeAttributeGetter(const v8::Fun
ctionCallbackInfo<v8::Value>& info) | 106 static void doNotCheckSecurityReadonlyLongAttributeAttributeGetter(const v8::Pro
pertyCallbackInfo<v8::Value>& info) |
| 125 { | 107 { |
| 126 v8::Local<v8::Object> holder = info.Holder(); | 108 v8::Local<v8::Object> holder = info.Holder(); |
| 127 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); | 109 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); |
| 128 v8SetReturnValueInt(info, impl->doNotCheckSecurityReadonlyLongAttribute()); | 110 v8SetReturnValueInt(info, impl->doNotCheckSecurityReadonlyLongAttribute()); |
| 129 } | 111 } |
| 130 | 112 |
| 131 static void doNotCheckSecurityReadonlyLongAttributeAttributeGetterCallback(const
v8::FunctionCallbackInfo<v8::Value>& info) | 113 static void doNotCheckSecurityReadonlyLongAttributeAttributeGetterCallback(v8::L
ocal<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 132 { | 114 { |
| 133 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadonlyLongAttribut
eAttributeGetter(info); | 115 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadonlyLongAttribut
eAttributeGetter(info); |
| 134 } | 116 } |
| 135 | 117 |
| 136 static void doNotCheckSecurityOnSetterLongAttributeAttributeGetter(const v8::Fun
ctionCallbackInfo<v8::Value>& info) | 118 static void doNotCheckSecurityOnSetterLongAttributeAttributeGetter(const v8::Pro
pertyCallbackInfo<v8::Value>& info) |
| 137 { | 119 { |
| 138 v8::Local<v8::Object> holder = info.Holder(); | 120 v8::Local<v8::Object> holder = info.Holder(); |
| 139 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); | 121 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); |
| 140 v8SetReturnValueInt(info, impl->doNotCheckSecurityOnSetterLongAttribute()); | 122 v8SetReturnValueInt(info, impl->doNotCheckSecurityOnSetterLongAttribute()); |
| 141 } | 123 } |
| 142 | 124 |
| 143 static void doNotCheckSecurityOnSetterLongAttributeAttributeGetterCallback(const
v8::FunctionCallbackInfo<v8::Value>& info) | 125 static void doNotCheckSecurityOnSetterLongAttributeAttributeGetterCallback(v8::L
ocal<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 144 { | 126 { |
| 145 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttribut
eAttributeGetter(info); | 127 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttribut
eAttributeGetter(info); |
| 146 } | 128 } |
| 147 | 129 |
| 148 static void doNotCheckSecurityOnSetterLongAttributeAttributeSetter(v8::Local<v8:
:Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) | 130 static void doNotCheckSecurityOnSetterLongAttributeAttributeSetter(v8::Local<v8:
:Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| 149 { | 131 { |
| 150 v8::Local<v8::Object> holder = info.Holder(); | 132 v8::Local<v8::Object> holder = info.Holder(); |
| 151 ExceptionState exceptionState(ExceptionState::SetterContext, "doNotCheckSecu
rityOnSetterLongAttribute", "TestInterfaceCheckSecurity", holder, info.GetIsolat
e()); | 133 ExceptionState exceptionState(ExceptionState::SetterContext, "doNotCheckSecu
rityOnSetterLongAttribute", "TestInterfaceCheckSecurity", holder, info.GetIsolat
e()); |
| 152 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); | 134 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); |
| 153 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); | 135 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); |
| 154 if (exceptionState.throwIfNeeded()) | 136 if (exceptionState.throwIfNeeded()) |
| 155 return; | 137 return; |
| 156 impl->setDoNotCheckSecurityOnSetterLongAttribute(cppValue); | 138 impl->setDoNotCheckSecurityOnSetterLongAttribute(cppValue); |
| 157 } | 139 } |
| 158 | 140 |
| 159 static void doNotCheckSecurityOnSetterLongAttributeAttributeSetterCallback(const
v8::FunctionCallbackInfo<v8::Value>& info) | 141 static void doNotCheckSecurityOnSetterLongAttributeAttributeSetterCallback(v8::L
ocal<v8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<voi
d>& info) |
| 160 { | 142 { |
| 161 v8::Local<v8::Value> v8Value = info[0]; | |
| 162 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttribut
eAttributeSetter(v8Value, info); | 143 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttribut
eAttributeSetter(v8Value, info); |
| 163 } | 144 } |
| 164 | 145 |
| 165 static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetter(co
nst v8::FunctionCallbackInfo<v8::Value>& info) | 146 static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetter(co
nst v8::PropertyCallbackInfo<v8::Value>& info) |
| 166 { | 147 { |
| 167 v8::Local<v8::Object> holder = info.Holder(); | 148 v8::Local<v8::Object> holder = info.Holder(); |
| 168 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); | 149 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); |
| 169 v8SetReturnValueInt(info, impl->doNotCheckSecurityReplaceableReadonlyLongAtt
ribute()); | 150 v8SetReturnValueInt(info, impl->doNotCheckSecurityReplaceableReadonlyLongAtt
ribute()); |
| 170 } | 151 } |
| 171 | 152 |
| 172 static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetterCal
lback(const v8::FunctionCallbackInfo<v8::Value>& info) | 153 static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetterCal
lback(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 173 { | 154 { |
| 174 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReplaceableReadonlyL
ongAttributeAttributeGetter(info); | 155 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReplaceableReadonlyL
ongAttributeAttributeGetter(info); |
| 175 } | 156 } |
| 176 | 157 |
| 177 static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeSetter(v8
::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) | |
| 178 { | |
| 179 v8::Local<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "doNo
tCheckSecurityReplaceableReadonlyLongAttribute"); | |
| 180 v8CallBoolean(info.This()->CreateDataProperty(info.GetIsolate()->GetCurrentC
ontext(), propertyName, v8Value)); | |
| 181 } | |
| 182 | |
| 183 static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeSetterCal
lback(const v8::FunctionCallbackInfo<v8::Value>& info) | |
| 184 { | |
| 185 v8::Local<v8::Value> v8Value = info[0]; | |
| 186 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReplaceableReadonlyL
ongAttributeAttributeSetter(v8Value, info); | |
| 187 } | |
| 188 | |
| 189 bool securityCheck(v8::Local<v8::Context> accessingContext, v8::Local<v8::Object
> accessedObject, v8::Local<v8::Value> data) | 158 bool securityCheck(v8::Local<v8::Context> accessingContext, v8::Local<v8::Object
> accessedObject, v8::Local<v8::Value> data) |
| 190 { | 159 { |
| 191 // TODO(jochen): Take accessingContext into account. | 160 // TODO(jochen): Take accessingContext into account. |
| 192 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(acce
ssedObject); | 161 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(acce
ssedObject); |
| 193 return BindingSecurity::shouldAllowAccessTo(v8::Isolate::GetCurrent(), calli
ngDOMWindow(v8::Isolate::GetCurrent()), impl, DoNotReportSecurityError); | 162 return BindingSecurity::shouldAllowAccessTo(v8::Isolate::GetCurrent(), calli
ngDOMWindow(v8::Isolate::GetCurrent()), impl, DoNotReportSecurityError); |
| 194 } | 163 } |
| 195 | 164 |
| 196 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 165 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 197 { | 166 { |
| 198 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethod"
, "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate()); | 167 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethod"
, "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate()); |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 V8HiddenValue::setHiddenValue(ScriptState::current(info.GetIsolate()), v8::L
ocal<v8::Object>::Cast(info.This()), name.As<v8::String>(), v8Value); | 386 V8HiddenValue::setHiddenValue(ScriptState::current(info.GetIsolate()), v8::L
ocal<v8::Object>::Cast(info.This()), name.As<v8::String>(), v8Value); |
| 418 } | 387 } |
| 419 | 388 |
| 420 static void TestInterfaceCheckSecurityOriginSafeMethodSetterCallback(v8::Local<v
8::Name> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void
>& info) | 389 static void TestInterfaceCheckSecurityOriginSafeMethodSetterCallback(v8::Local<v
8::Name> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void
>& info) |
| 421 { | 390 { |
| 422 TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMe
thodSetter(name, v8Value, info); | 391 TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMe
thodSetter(name, v8Value, info); |
| 423 } | 392 } |
| 424 | 393 |
| 425 } // namespace TestInterfaceCheckSecurityV8Internal | 394 } // namespace TestInterfaceCheckSecurityV8Internal |
| 426 | 395 |
| 396 // Suppress warning: global constructors, because AttributeConfiguration is triv
ial |
| 397 // and does not depend on another global objects. |
| 398 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) |
| 399 #pragma clang diagnostic push |
| 400 #pragma clang diagnostic ignored "-Wglobal-constructors" |
| 401 #endif |
| 402 const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceCheckSecurityAtt
ributes[] = { |
| 403 {"doNotCheckSecurityLongAttribute", TestInterfaceCheckSecurityV8Internal::do
NotCheckSecurityLongAttributeAttributeGetterCallback, TestInterfaceCheckSecurity
V8Internal::doNotCheckSecurityLongAttributeAttributeSetterCallback, 0, 0, 0, sta
tic_cast<v8::AccessControl>(v8::ALL_CAN_READ | v8::ALL_CAN_WRITE), static_cast<v
8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMC
onfiguration::OnInstance, V8DOMConfiguration::CheckHolder}, |
| 404 {"doNotCheckSecurityReadonlyLongAttribute", TestInterfaceCheckSecurityV8Inte
rnal::doNotCheckSecurityReadonlyLongAttributeAttributeGetterCallback, 0, 0, 0, 0
, static_cast<v8::AccessControl>(v8::ALL_CAN_READ), static_cast<v8::PropertyAttr
ibute>(v8::ReadOnly), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguratio
n::OnInstance, V8DOMConfiguration::CheckHolder}, |
| 405 {"doNotCheckSecurityOnSetterLongAttribute", TestInterfaceCheckSecurityV8Inte
rnal::doNotCheckSecurityOnSetterLongAttributeAttributeGetterCallback, TestInterf
aceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttributeAttributeSett
erCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::ALL_CAN_WRITE), static_c
ast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V
8DOMConfiguration::OnInstance, V8DOMConfiguration::CheckHolder}, |
| 406 {"doNotCheckSecurityReplaceableReadonlyLongAttribute", TestInterfaceCheckSec
urityV8Internal::doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGett
erCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::ALL_CAN_READ), static
_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts,
V8DOMConfiguration::OnInstance, V8DOMConfiguration::CheckHolder}, |
| 407 }; |
| 408 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) |
| 409 #pragma clang diagnostic pop |
| 410 #endif |
| 411 |
| 427 const V8DOMConfiguration::AccessorConfiguration V8TestInterfaceCheckSecurityAcce
ssors[] = { | 412 const V8DOMConfiguration::AccessorConfiguration V8TestInterfaceCheckSecurityAcce
ssors[] = { |
| 428 {"readonlyLongAttribute", TestInterfaceCheckSecurityV8Internal::readonlyLong
AttributeAttributeGetterCallback, 0, 0, 0, 0, v8::DEFAULT, static_cast<v8::Prope
rtyAttribute>(v8::ReadOnly), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfi
guration::OnInstance, V8DOMConfiguration::CheckHolder}, | 413 {"readonlyLongAttribute", TestInterfaceCheckSecurityV8Internal::readonlyLong
AttributeAttributeGetterCallback, 0, 0, 0, 0, v8::DEFAULT, static_cast<v8::Prope
rtyAttribute>(v8::ReadOnly), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfi
guration::OnInstance, V8DOMConfiguration::CheckHolder}, |
| 429 {"longAttribute", TestInterfaceCheckSecurityV8Internal::longAttributeAttribu
teGetterCallback, TestInterfaceCheckSecurityV8Internal::longAttributeAttributeSe
tterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::PropertyAttribute>(v8::None)
, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance, V8DOM
Configuration::CheckHolder}, | 414 {"longAttribute", TestInterfaceCheckSecurityV8Internal::longAttributeAttribu
teGetterCallback, TestInterfaceCheckSecurityV8Internal::longAttributeAttributeSe
tterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::PropertyAttribute>(v8::None)
, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance, V8DOM
Configuration::CheckHolder}, |
| 430 {"doNotCheckSecurityLongAttribute", TestInterfaceCheckSecurityV8Internal::do
NotCheckSecurityLongAttributeAttributeGetterCallback, TestInterfaceCheckSecurity
V8Internal::doNotCheckSecurityLongAttributeAttributeSetterCallback, 0, 0, 0, v8:
:DEFAULT, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::Expo
sedToAllScripts, V8DOMConfiguration::OnInstance, V8DOMConfiguration::CheckHolder
}, | |
| 431 {"doNotCheckSecurityReadonlyLongAttribute", TestInterfaceCheckSecurityV8Inte
rnal::doNotCheckSecurityReadonlyLongAttributeAttributeGetterCallback, 0, 0, 0, 0
, v8::DEFAULT, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfigurat
ion::ExposedToAllScripts, V8DOMConfiguration::OnInstance, V8DOMConfiguration::Ch
eckHolder}, | |
| 432 {"doNotCheckSecurityOnSetterLongAttribute", TestInterfaceCheckSecurityV8Inte
rnal::doNotCheckSecurityOnSetterLongAttributeAttributeGetterCallback, TestInterf
aceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttributeAttributeSett
erCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::PropertyAttribute>(v8::None),
V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance, V8DOMCo
nfiguration::CheckHolder}, | |
| 433 {"doNotCheckSecurityReplaceableReadonlyLongAttribute", TestInterfaceCheckSec
urityV8Internal::doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGett
erCallback, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReplaceableR
eadonlyLongAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v
8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMC
onfiguration::OnInstance, V8DOMConfiguration::CheckHolder}, | |
| 434 }; | 415 }; |
| 435 | 416 |
| 436 const V8DOMConfiguration::MethodConfiguration V8TestInterfaceCheckSecurityMethod
s[] = { | 417 const V8DOMConfiguration::MethodConfiguration V8TestInterfaceCheckSecurityMethod
s[] = { |
| 437 {"voidMethod", TestInterfaceCheckSecurityV8Internal::voidMethodMethodCallbac
k, 0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::
OnInstance}, | 418 {"voidMethod", TestInterfaceCheckSecurityV8Internal::voidMethodMethodCallbac
k, 0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::
OnInstance}, |
| 438 }; | 419 }; |
| 439 | 420 |
| 440 static void installV8TestInterfaceCheckSecurityTemplate(v8::Isolate* isolate, co
nst DOMWrapperWorld& world, v8::Local<v8::FunctionTemplate> interfaceTemplate) | 421 static void installV8TestInterfaceCheckSecurityTemplate(v8::Isolate* isolate, co
nst DOMWrapperWorld& world, v8::Local<v8::FunctionTemplate> interfaceTemplate) |
| 441 { | 422 { |
| 442 // Initialize the interface object's template. | 423 // Initialize the interface object's template. |
| 443 V8DOMConfiguration::initializeDOMInterfaceTemplate(isolate, interfaceTemplat
e, V8TestInterfaceCheckSecurity::wrapperTypeInfo.interfaceName, v8::Local<v8::Fu
nctionTemplate>(), V8TestInterfaceCheckSecurity::internalFieldCount); | 424 V8DOMConfiguration::initializeDOMInterfaceTemplate(isolate, interfaceTemplat
e, V8TestInterfaceCheckSecurity::wrapperTypeInfo.interfaceName, v8::Local<v8::Fu
nctionTemplate>(), V8TestInterfaceCheckSecurity::internalFieldCount); |
| 444 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTe
mplate); | 425 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTe
mplate); |
| 445 ALLOW_UNUSED_LOCAL(signature); | 426 ALLOW_UNUSED_LOCAL(signature); |
| 446 v8::Local<v8::ObjectTemplate> instanceTemplate = interfaceTemplate->Instance
Template(); | 427 v8::Local<v8::ObjectTemplate> instanceTemplate = interfaceTemplate->Instance
Template(); |
| 447 ALLOW_UNUSED_LOCAL(instanceTemplate); | 428 ALLOW_UNUSED_LOCAL(instanceTemplate); |
| 448 v8::Local<v8::ObjectTemplate> prototypeTemplate = interfaceTemplate->Prototy
peTemplate(); | 429 v8::Local<v8::ObjectTemplate> prototypeTemplate = interfaceTemplate->Prototy
peTemplate(); |
| 449 ALLOW_UNUSED_LOCAL(prototypeTemplate); | 430 ALLOW_UNUSED_LOCAL(prototypeTemplate); |
| 450 // Register DOM constants, attributes and operations. | 431 // Register DOM constants, attributes and operations. |
| 432 V8DOMConfiguration::installAttributes(isolate, world, instanceTemplate, prot
otypeTemplate, V8TestInterfaceCheckSecurityAttributes, WTF_ARRAY_LENGTH(V8TestIn
terfaceCheckSecurityAttributes)); |
| 451 V8DOMConfiguration::installAccessors(isolate, world, instanceTemplate, proto
typeTemplate, interfaceTemplate, signature, V8TestInterfaceCheckSecurityAccessor
s, WTF_ARRAY_LENGTH(V8TestInterfaceCheckSecurityAccessors)); | 433 V8DOMConfiguration::installAccessors(isolate, world, instanceTemplate, proto
typeTemplate, interfaceTemplate, signature, V8TestInterfaceCheckSecurityAccessor
s, WTF_ARRAY_LENGTH(V8TestInterfaceCheckSecurityAccessors)); |
| 452 V8DOMConfiguration::installMethods(isolate, world, instanceTemplate, prototy
peTemplate, interfaceTemplate, signature, V8TestInterfaceCheckSecurityMethods, W
TF_ARRAY_LENGTH(V8TestInterfaceCheckSecurityMethods)); | 434 V8DOMConfiguration::installMethods(isolate, world, instanceTemplate, prototy
peTemplate, interfaceTemplate, signature, V8TestInterfaceCheckSecurityMethods, W
TF_ARRAY_LENGTH(V8TestInterfaceCheckSecurityMethods)); |
| 453 | 435 |
| 454 // Cross-origin access check | 436 // Cross-origin access check |
| 455 instanceTemplate->SetAccessCheckCallback(TestInterfaceCheckSecurityV8Interna
l::securityCheck, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&V8Tes
tInterfaceCheckSecurity::wrapperTypeInfo))); | 437 instanceTemplate->SetAccessCheckCallback(TestInterfaceCheckSecurityV8Interna
l::securityCheck, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&V8Tes
tInterfaceCheckSecurity::wrapperTypeInfo))); |
| 456 | 438 |
| 457 const V8DOMConfiguration::AttributeConfiguration doNotCheckSecurityVoidMetho
dOriginSafeAttributeConfiguration = { | 439 const V8DOMConfiguration::AttributeConfiguration doNotCheckSecurityVoidMetho
dOriginSafeAttributeConfiguration = { |
| 458 "doNotCheckSecurityVoidMethod", TestInterfaceCheckSecurityV8Internal::do
NotCheckSecurityVoidMethodOriginSafeMethodGetterCallback, TestInterfaceCheckSecu
rityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback, 0, 0,
&V8TestInterfaceCheckSecurity::wrapperTypeInfo, v8::ALL_CAN_READ, static_cast<v8
::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMCo
nfiguration::OnInstance, V8DOMConfiguration::CheckHolder, | 440 "doNotCheckSecurityVoidMethod", TestInterfaceCheckSecurityV8Internal::do
NotCheckSecurityVoidMethodOriginSafeMethodGetterCallback, TestInterfaceCheckSecu
rityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback, 0, 0,
&V8TestInterfaceCheckSecurity::wrapperTypeInfo, v8::ALL_CAN_READ, static_cast<v8
::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMCo
nfiguration::OnInstance, V8DOMConfiguration::CheckHolder, |
| 459 }; | 441 }; |
| 460 V8DOMConfiguration::installAttribute(isolate, world, instanceTemplate, proto
typeTemplate, doNotCheckSecurityVoidMethodOriginSafeAttributeConfiguration); | 442 V8DOMConfiguration::installAttribute(isolate, world, instanceTemplate, proto
typeTemplate, doNotCheckSecurityVoidMethodOriginSafeAttributeConfiguration); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 482 { | 464 { |
| 483 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); | 465 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); |
| 484 } | 466 } |
| 485 | 467 |
| 486 TestInterfaceCheckSecurity* V8TestInterfaceCheckSecurity::toImplWithTypeCheck(v8
::Isolate* isolate, v8::Local<v8::Value> value) | 468 TestInterfaceCheckSecurity* V8TestInterfaceCheckSecurity::toImplWithTypeCheck(v8
::Isolate* isolate, v8::Local<v8::Value> value) |
| 487 { | 469 { |
| 488 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : 0; | 470 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : 0; |
| 489 } | 471 } |
| 490 | 472 |
| 491 } // namespace blink | 473 } // namespace blink |
| OLD | NEW |