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 } |
41 v8SetReturnValueInt(info, impl->readonlyLongAttribute()); | 47 v8SetReturnValueInt(info, impl->readonlyLongAttribute()); |
42 } | 48 } |
43 | 49 |
44 static void readonlyLongAttributeAttributeGetterCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) | 50 static void readonlyLongAttributeAttributeGetterCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
45 { | 51 { |
46 TestInterfaceCheckSecurityV8Internal::readonlyLongAttributeAttributeGetter(i
nfo); | 52 TestInterfaceCheckSecurityV8Internal::readonlyLongAttributeAttributeGetter(i
nfo); |
47 } | 53 } |
48 | 54 |
49 static void longAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Valu
e>& info) | 55 static void longAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
50 { | 56 { |
51 v8::Local<v8::Object> holder = info.Holder(); | 57 v8::Local<v8::Object> holder = info.Holder(); |
52 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); | 58 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 } |
53 v8SetReturnValueInt(info, impl->longAttribute()); | 65 v8SetReturnValueInt(info, impl->longAttribute()); |
54 } | 66 } |
55 | 67 |
56 static void longAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) | 68 static void longAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) |
57 { | 69 { |
58 TestInterfaceCheckSecurityV8Internal::longAttributeAttributeGetter(info); | 70 TestInterfaceCheckSecurityV8Internal::longAttributeAttributeGetter(info); |
59 } | 71 } |
60 | 72 |
61 static void longAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8:
:FunctionCallbackInfo<v8::Value>& info) | 73 static void longAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8:
:FunctionCallbackInfo<v8::Value>& info) |
62 { | 74 { |
63 v8::Local<v8::Object> holder = info.Holder(); | 75 v8::Local<v8::Object> holder = info.Holder(); |
64 ExceptionState exceptionState(ExceptionState::SetterContext, "longAttribute"
, "TestInterfaceCheckSecurity", holder, info.GetIsolate()); | 76 ExceptionState exceptionState(ExceptionState::SetterContext, "longAttribute"
, "TestInterfaceCheckSecurity", holder, info.GetIsolate()); |
65 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); | 77 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 } |
66 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); | 83 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); |
67 if (exceptionState.throwIfNeeded()) | 84 if (exceptionState.throwIfNeeded()) |
68 return; | 85 return; |
69 impl->setLongAttribute(cppValue); | 86 impl->setLongAttribute(cppValue); |
70 } | 87 } |
71 | 88 |
72 static void longAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) | 89 static void longAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) |
73 { | 90 { |
74 v8::Local<v8::Value> v8Value = info[0]; | 91 v8::Local<v8::Value> v8Value = info[0]; |
75 TestInterfaceCheckSecurityV8Internal::longAttributeAttributeSetter(v8Value,
info); | 92 TestInterfaceCheckSecurityV8Internal::longAttributeAttributeSetter(v8Value,
info); |
76 } | 93 } |
77 | 94 |
78 static void doNotCheckSecurityLongAttributeAttributeGetter(const v8::PropertyCal
lbackInfo<v8::Value>& info) | 95 static void doNotCheckSecurityLongAttributeAttributeGetter(const v8::FunctionCal
lbackInfo<v8::Value>& info) |
79 { | 96 { |
80 v8::Local<v8::Object> holder = info.Holder(); | 97 v8::Local<v8::Object> holder = info.Holder(); |
81 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); | 98 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); |
82 v8SetReturnValueInt(info, impl->doNotCheckSecurityLongAttribute()); | 99 v8SetReturnValueInt(info, impl->doNotCheckSecurityLongAttribute()); |
83 } | 100 } |
84 | 101 |
85 static void doNotCheckSecurityLongAttributeAttributeGetterCallback(v8::Local<v8:
:Name>, const v8::PropertyCallbackInfo<v8::Value>& info) | 102 static void doNotCheckSecurityLongAttributeAttributeGetterCallback(const v8::Fun
ctionCallbackInfo<v8::Value>& info) |
86 { | 103 { |
87 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttribu
teGetter(info); | 104 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttribu
teGetter(info); |
88 } | 105 } |
89 | 106 |
90 static void doNotCheckSecurityLongAttributeAttributeSetter(v8::Local<v8::Value>
v8Value, const v8::PropertyCallbackInfo<void>& info) | 107 static void doNotCheckSecurityLongAttributeAttributeSetter(v8::Local<v8::Value>
v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) |
91 { | 108 { |
92 v8::Local<v8::Object> holder = info.Holder(); | 109 v8::Local<v8::Object> holder = info.Holder(); |
93 ExceptionState exceptionState(ExceptionState::SetterContext, "doNotCheckSecu
rityLongAttribute", "TestInterfaceCheckSecurity", holder, info.GetIsolate()); | 110 ExceptionState exceptionState(ExceptionState::SetterContext, "doNotCheckSecu
rityLongAttribute", "TestInterfaceCheckSecurity", holder, info.GetIsolate()); |
94 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); | 111 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); |
95 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); | 112 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); |
96 if (exceptionState.throwIfNeeded()) | 113 if (exceptionState.throwIfNeeded()) |
97 return; | 114 return; |
98 impl->setDoNotCheckSecurityLongAttribute(cppValue); | 115 impl->setDoNotCheckSecurityLongAttribute(cppValue); |
99 } | 116 } |
100 | 117 |
101 static void doNotCheckSecurityLongAttributeAttributeSetterCallback(v8::Local<v8:
:Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info
) | 118 static void doNotCheckSecurityLongAttributeAttributeSetterCallback(const v8::Fun
ctionCallbackInfo<v8::Value>& info) |
102 { | 119 { |
| 120 v8::Local<v8::Value> v8Value = info[0]; |
103 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttribu
teSetter(v8Value, info); | 121 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttribu
teSetter(v8Value, info); |
104 } | 122 } |
105 | 123 |
106 static void doNotCheckSecurityReadonlyLongAttributeAttributeGetter(const v8::Pro
pertyCallbackInfo<v8::Value>& info) | 124 static void doNotCheckSecurityReadonlyLongAttributeAttributeGetter(const v8::Fun
ctionCallbackInfo<v8::Value>& info) |
107 { | 125 { |
108 v8::Local<v8::Object> holder = info.Holder(); | 126 v8::Local<v8::Object> holder = info.Holder(); |
109 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); | 127 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); |
110 v8SetReturnValueInt(info, impl->doNotCheckSecurityReadonlyLongAttribute()); | 128 v8SetReturnValueInt(info, impl->doNotCheckSecurityReadonlyLongAttribute()); |
111 } | 129 } |
112 | 130 |
113 static void doNotCheckSecurityReadonlyLongAttributeAttributeGetterCallback(v8::L
ocal<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) | 131 static void doNotCheckSecurityReadonlyLongAttributeAttributeGetterCallback(const
v8::FunctionCallbackInfo<v8::Value>& info) |
114 { | 132 { |
115 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadonlyLongAttribut
eAttributeGetter(info); | 133 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadonlyLongAttribut
eAttributeGetter(info); |
116 } | 134 } |
117 | 135 |
118 static void doNotCheckSecurityOnSetterLongAttributeAttributeGetter(const v8::Pro
pertyCallbackInfo<v8::Value>& info) | 136 static void doNotCheckSecurityOnSetterLongAttributeAttributeGetter(const v8::Fun
ctionCallbackInfo<v8::Value>& info) |
119 { | 137 { |
120 v8::Local<v8::Object> holder = info.Holder(); | 138 v8::Local<v8::Object> holder = info.Holder(); |
121 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); | 139 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); |
122 v8SetReturnValueInt(info, impl->doNotCheckSecurityOnSetterLongAttribute()); | 140 v8SetReturnValueInt(info, impl->doNotCheckSecurityOnSetterLongAttribute()); |
123 } | 141 } |
124 | 142 |
125 static void doNotCheckSecurityOnSetterLongAttributeAttributeGetterCallback(v8::L
ocal<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) | 143 static void doNotCheckSecurityOnSetterLongAttributeAttributeGetterCallback(const
v8::FunctionCallbackInfo<v8::Value>& info) |
126 { | 144 { |
127 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttribut
eAttributeGetter(info); | 145 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttribut
eAttributeGetter(info); |
128 } | 146 } |
129 | 147 |
130 static void doNotCheckSecurityOnSetterLongAttributeAttributeSetter(v8::Local<v8:
:Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | 148 static void doNotCheckSecurityOnSetterLongAttributeAttributeSetter(v8::Local<v8:
:Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) |
131 { | 149 { |
132 v8::Local<v8::Object> holder = info.Holder(); | 150 v8::Local<v8::Object> holder = info.Holder(); |
133 ExceptionState exceptionState(ExceptionState::SetterContext, "doNotCheckSecu
rityOnSetterLongAttribute", "TestInterfaceCheckSecurity", holder, info.GetIsolat
e()); | 151 ExceptionState exceptionState(ExceptionState::SetterContext, "doNotCheckSecu
rityOnSetterLongAttribute", "TestInterfaceCheckSecurity", holder, info.GetIsolat
e()); |
134 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); | 152 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); |
135 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); | 153 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); |
136 if (exceptionState.throwIfNeeded()) | 154 if (exceptionState.throwIfNeeded()) |
137 return; | 155 return; |
138 impl->setDoNotCheckSecurityOnSetterLongAttribute(cppValue); | 156 impl->setDoNotCheckSecurityOnSetterLongAttribute(cppValue); |
139 } | 157 } |
140 | 158 |
141 static void doNotCheckSecurityOnSetterLongAttributeAttributeSetterCallback(v8::L
ocal<v8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<voi
d>& info) | 159 static void doNotCheckSecurityOnSetterLongAttributeAttributeSetterCallback(const
v8::FunctionCallbackInfo<v8::Value>& info) |
142 { | 160 { |
| 161 v8::Local<v8::Value> v8Value = info[0]; |
143 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttribut
eAttributeSetter(v8Value, info); | 162 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttribut
eAttributeSetter(v8Value, info); |
144 } | 163 } |
145 | 164 |
146 static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetter(co
nst v8::PropertyCallbackInfo<v8::Value>& info) | 165 static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetter(co
nst v8::FunctionCallbackInfo<v8::Value>& info) |
147 { | 166 { |
148 v8::Local<v8::Object> holder = info.Holder(); | 167 v8::Local<v8::Object> holder = info.Holder(); |
149 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); | 168 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); |
150 v8SetReturnValueInt(info, impl->doNotCheckSecurityReplaceableReadonlyLongAtt
ribute()); | 169 v8SetReturnValueInt(info, impl->doNotCheckSecurityReplaceableReadonlyLongAtt
ribute()); |
151 } | 170 } |
152 | 171 |
153 static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetterCal
lback(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) | 172 static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetterCal
lback(const v8::FunctionCallbackInfo<v8::Value>& info) |
154 { | 173 { |
155 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReplaceableReadonlyL
ongAttributeAttributeGetter(info); | 174 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReplaceableReadonlyL
ongAttributeAttributeGetter(info); |
156 } | 175 } |
157 | 176 |
| 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 |
158 bool securityCheck(v8::Local<v8::Context> accessingContext, v8::Local<v8::Object
> accessedObject, v8::Local<v8::Value> data) | 189 bool securityCheck(v8::Local<v8::Context> accessingContext, v8::Local<v8::Object
> accessedObject, v8::Local<v8::Value> data) |
159 { | 190 { |
160 // TODO(jochen): Take accessingContext into account. | 191 // TODO(jochen): Take accessingContext into account. |
161 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(acce
ssedObject); | 192 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(acce
ssedObject); |
162 return BindingSecurity::shouldAllowAccessTo(v8::Isolate::GetCurrent(), calli
ngDOMWindow(v8::Isolate::GetCurrent()), impl, DoNotReportSecurityError); | 193 return BindingSecurity::shouldAllowAccessTo(v8::Isolate::GetCurrent(), calli
ngDOMWindow(v8::Isolate::GetCurrent()), impl, DoNotReportSecurityError); |
163 } | 194 } |
164 | 195 |
165 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 196 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
166 { | 197 { |
167 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethod"
, "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate()); | 198 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethod"
, "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate()); |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 V8HiddenValue::setHiddenValue(ScriptState::current(info.GetIsolate()), v8::L
ocal<v8::Object>::Cast(info.This()), name.As<v8::String>(), v8Value); | 417 V8HiddenValue::setHiddenValue(ScriptState::current(info.GetIsolate()), v8::L
ocal<v8::Object>::Cast(info.This()), name.As<v8::String>(), v8Value); |
387 } | 418 } |
388 | 419 |
389 static void TestInterfaceCheckSecurityOriginSafeMethodSetterCallback(v8::Local<v
8::Name> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void
>& info) | 420 static void TestInterfaceCheckSecurityOriginSafeMethodSetterCallback(v8::Local<v
8::Name> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void
>& info) |
390 { | 421 { |
391 TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMe
thodSetter(name, v8Value, info); | 422 TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMe
thodSetter(name, v8Value, info); |
392 } | 423 } |
393 | 424 |
394 } // namespace TestInterfaceCheckSecurityV8Internal | 425 } // namespace TestInterfaceCheckSecurityV8Internal |
395 | 426 |
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 | |
412 const V8DOMConfiguration::AccessorConfiguration V8TestInterfaceCheckSecurityAcce
ssors[] = { | 427 const V8DOMConfiguration::AccessorConfiguration V8TestInterfaceCheckSecurityAcce
ssors[] = { |
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}, | 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}, |
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}, | 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}, |
| 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}, |
415 }; | 434 }; |
416 | 435 |
417 const V8DOMConfiguration::MethodConfiguration V8TestInterfaceCheckSecurityMethod
s[] = { | 436 const V8DOMConfiguration::MethodConfiguration V8TestInterfaceCheckSecurityMethod
s[] = { |
418 {"voidMethod", TestInterfaceCheckSecurityV8Internal::voidMethodMethodCallbac
k, 0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::
OnInstance}, | 437 {"voidMethod", TestInterfaceCheckSecurityV8Internal::voidMethodMethodCallbac
k, 0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::
OnInstance}, |
419 }; | 438 }; |
420 | 439 |
421 static void installV8TestInterfaceCheckSecurityTemplate(v8::Isolate* isolate, co
nst DOMWrapperWorld& world, v8::Local<v8::FunctionTemplate> interfaceTemplate) | 440 static void installV8TestInterfaceCheckSecurityTemplate(v8::Isolate* isolate, co
nst DOMWrapperWorld& world, v8::Local<v8::FunctionTemplate> interfaceTemplate) |
422 { | 441 { |
423 // Initialize the interface object's template. | 442 // Initialize the interface object's template. |
424 V8DOMConfiguration::initializeDOMInterfaceTemplate(isolate, interfaceTemplat
e, V8TestInterfaceCheckSecurity::wrapperTypeInfo.interfaceName, v8::Local<v8::Fu
nctionTemplate>(), V8TestInterfaceCheckSecurity::internalFieldCount); | 443 V8DOMConfiguration::initializeDOMInterfaceTemplate(isolate, interfaceTemplat
e, V8TestInterfaceCheckSecurity::wrapperTypeInfo.interfaceName, v8::Local<v8::Fu
nctionTemplate>(), V8TestInterfaceCheckSecurity::internalFieldCount); |
425 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTe
mplate); | 444 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTe
mplate); |
426 ALLOW_UNUSED_LOCAL(signature); | 445 ALLOW_UNUSED_LOCAL(signature); |
427 v8::Local<v8::ObjectTemplate> instanceTemplate = interfaceTemplate->Instance
Template(); | 446 v8::Local<v8::ObjectTemplate> instanceTemplate = interfaceTemplate->Instance
Template(); |
428 ALLOW_UNUSED_LOCAL(instanceTemplate); | 447 ALLOW_UNUSED_LOCAL(instanceTemplate); |
429 v8::Local<v8::ObjectTemplate> prototypeTemplate = interfaceTemplate->Prototy
peTemplate(); | 448 v8::Local<v8::ObjectTemplate> prototypeTemplate = interfaceTemplate->Prototy
peTemplate(); |
430 ALLOW_UNUSED_LOCAL(prototypeTemplate); | 449 ALLOW_UNUSED_LOCAL(prototypeTemplate); |
431 // Register DOM constants, attributes and operations. | 450 // Register DOM constants, attributes and operations. |
432 V8DOMConfiguration::installAttributes(isolate, world, instanceTemplate, prot
otypeTemplate, V8TestInterfaceCheckSecurityAttributes, WTF_ARRAY_LENGTH(V8TestIn
terfaceCheckSecurityAttributes)); | |
433 V8DOMConfiguration::installAccessors(isolate, world, instanceTemplate, proto
typeTemplate, interfaceTemplate, signature, V8TestInterfaceCheckSecurityAccessor
s, WTF_ARRAY_LENGTH(V8TestInterfaceCheckSecurityAccessors)); | 451 V8DOMConfiguration::installAccessors(isolate, world, instanceTemplate, proto
typeTemplate, interfaceTemplate, signature, V8TestInterfaceCheckSecurityAccessor
s, WTF_ARRAY_LENGTH(V8TestInterfaceCheckSecurityAccessors)); |
434 V8DOMConfiguration::installMethods(isolate, world, instanceTemplate, prototy
peTemplate, interfaceTemplate, signature, V8TestInterfaceCheckSecurityMethods, W
TF_ARRAY_LENGTH(V8TestInterfaceCheckSecurityMethods)); | 452 V8DOMConfiguration::installMethods(isolate, world, instanceTemplate, prototy
peTemplate, interfaceTemplate, signature, V8TestInterfaceCheckSecurityMethods, W
TF_ARRAY_LENGTH(V8TestInterfaceCheckSecurityMethods)); |
435 | 453 |
436 // Cross-origin access check | 454 // Cross-origin access check |
437 instanceTemplate->SetAccessCheckCallback(TestInterfaceCheckSecurityV8Interna
l::securityCheck, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&V8Tes
tInterfaceCheckSecurity::wrapperTypeInfo))); | 455 instanceTemplate->SetAccessCheckCallback(TestInterfaceCheckSecurityV8Interna
l::securityCheck, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&V8Tes
tInterfaceCheckSecurity::wrapperTypeInfo))); |
438 | 456 |
439 const V8DOMConfiguration::AttributeConfiguration doNotCheckSecurityVoidMetho
dOriginSafeAttributeConfiguration = { | 457 const V8DOMConfiguration::AttributeConfiguration doNotCheckSecurityVoidMetho
dOriginSafeAttributeConfiguration = { |
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, | 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, |
441 }; | 459 }; |
442 V8DOMConfiguration::installAttribute(isolate, world, instanceTemplate, proto
typeTemplate, doNotCheckSecurityVoidMethodOriginSafeAttributeConfiguration); | 460 V8DOMConfiguration::installAttribute(isolate, world, instanceTemplate, proto
typeTemplate, doNotCheckSecurityVoidMethodOriginSafeAttributeConfiguration); |
(...skipping 21 matching lines...) Expand all Loading... |
464 { | 482 { |
465 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); | 483 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); |
466 } | 484 } |
467 | 485 |
468 TestInterfaceCheckSecurity* V8TestInterfaceCheckSecurity::toImplWithTypeCheck(v8
::Isolate* isolate, v8::Local<v8::Value> value) | 486 TestInterfaceCheckSecurity* V8TestInterfaceCheckSecurity::toImplWithTypeCheck(v8
::Isolate* isolate, v8::Local<v8::Value> value) |
469 { | 487 { |
470 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : 0; | 488 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : 0; |
471 } | 489 } |
472 | 490 |
473 } // namespace blink | 491 } // namespace blink |
OLD | NEW |