| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 namespace TestInterfaceCheckSecurityV8Internal { | 49 namespace TestInterfaceCheckSecurityV8Internal { |
| 50 | 50 |
| 51 static void readonlyLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<
v8::Value>& info) | 51 static void readonlyLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<
v8::Value>& info) |
| 52 { | 52 { |
| 53 v8::Local<v8::Object> holder = info.Holder(); | 53 v8::Local<v8::Object> holder = info.Holder(); |
| 54 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); | 54 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); |
| 55 ExceptionState exceptionState(ExceptionState::GetterContext, "readonlyLongAt
tribute", "TestInterfaceCheckSecurity", holder, info.GetIsolate()); | 55 ExceptionState exceptionState(ExceptionState::GetterContext, "readonlyLongAt
tribute", "TestInterfaceCheckSecurity", holder, info.GetIsolate()); |
| 56 if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()
), impl, exceptionState)) { | 56 if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()
), impl, exceptionState)) { |
| 57 v8SetReturnValueNull(info); | 57 v8SetReturnValueNull(info); |
| 58 exceptionState.throwIfNeeded(); | |
| 59 return; | 58 return; |
| 60 } | 59 } |
| 61 v8SetReturnValueInt(info, impl->readonlyLongAttribute()); | 60 v8SetReturnValueInt(info, impl->readonlyLongAttribute()); |
| 62 } | 61 } |
| 63 | 62 |
| 64 static void readonlyLongAttributeAttributeGetterCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) | 63 static void readonlyLongAttributeAttributeGetterCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
| 65 { | 64 { |
| 66 TestInterfaceCheckSecurityV8Internal::readonlyLongAttributeAttributeGetter(i
nfo); | 65 TestInterfaceCheckSecurityV8Internal::readonlyLongAttributeAttributeGetter(i
nfo); |
| 67 } | 66 } |
| 68 | 67 |
| 69 static void longAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Valu
e>& info) | 68 static void longAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
| 70 { | 69 { |
| 71 v8::Local<v8::Object> holder = info.Holder(); | 70 v8::Local<v8::Object> holder = info.Holder(); |
| 72 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); | 71 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); |
| 73 ExceptionState exceptionState(ExceptionState::GetterContext, "longAttribute"
, "TestInterfaceCheckSecurity", holder, info.GetIsolate()); | 72 ExceptionState exceptionState(ExceptionState::GetterContext, "longAttribute"
, "TestInterfaceCheckSecurity", holder, info.GetIsolate()); |
| 74 if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()
), impl, exceptionState)) { | 73 if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()
), impl, exceptionState)) { |
| 75 v8SetReturnValueNull(info); | 74 v8SetReturnValueNull(info); |
| 76 exceptionState.throwIfNeeded(); | |
| 77 return; | 75 return; |
| 78 } | 76 } |
| 79 v8SetReturnValueInt(info, impl->longAttribute()); | 77 v8SetReturnValueInt(info, impl->longAttribute()); |
| 80 } | 78 } |
| 81 | 79 |
| 82 static void longAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) | 80 static void longAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) |
| 83 { | 81 { |
| 84 TestInterfaceCheckSecurityV8Internal::longAttributeAttributeGetter(info); | 82 TestInterfaceCheckSecurityV8Internal::longAttributeAttributeGetter(info); |
| 85 } | 83 } |
| 86 | 84 |
| 87 static void longAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8:
:FunctionCallbackInfo<v8::Value>& info) | 85 static void longAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8:
:FunctionCallbackInfo<v8::Value>& info) |
| 88 { | 86 { |
| 89 v8::Local<v8::Object> holder = info.Holder(); | 87 v8::Local<v8::Object> holder = info.Holder(); |
| 90 ExceptionState exceptionState(ExceptionState::SetterContext, "longAttribute"
, "TestInterfaceCheckSecurity", holder, info.GetIsolate()); | 88 ExceptionState exceptionState(ExceptionState::SetterContext, "longAttribute"
, "TestInterfaceCheckSecurity", holder, info.GetIsolate()); |
| 91 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); | 89 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); |
| 92 if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()
), impl, exceptionState)) { | 90 if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()
), impl, exceptionState)) { |
| 93 v8SetReturnValue(info, v8Value); | 91 v8SetReturnValue(info, v8Value); |
| 94 exceptionState.throwIfNeeded(); | |
| 95 return; | 92 return; |
| 96 } | 93 } |
| 97 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); | 94 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); |
| 98 if (exceptionState.throwIfNeeded()) | 95 if (exceptionState.hadException()) |
| 99 return; | 96 return; |
| 100 impl->setLongAttribute(cppValue); | 97 impl->setLongAttribute(cppValue); |
| 101 } | 98 } |
| 102 | 99 |
| 103 static void longAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) | 100 static void longAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) |
| 104 { | 101 { |
| 105 v8::Local<v8::Value> v8Value = info[0]; | 102 v8::Local<v8::Value> v8Value = info[0]; |
| 106 TestInterfaceCheckSecurityV8Internal::longAttributeAttributeSetter(v8Value,
info); | 103 TestInterfaceCheckSecurityV8Internal::longAttributeAttributeSetter(v8Value,
info); |
| 107 } | 104 } |
| 108 | 105 |
| 109 static void doNotCheckSecurityLongAttributeAttributeGetter(const v8::FunctionCal
lbackInfo<v8::Value>& info) | 106 static void doNotCheckSecurityLongAttributeAttributeGetter(const v8::FunctionCal
lbackInfo<v8::Value>& info) |
| 110 { | 107 { |
| 111 v8::Local<v8::Object> holder = info.Holder(); | 108 v8::Local<v8::Object> holder = info.Holder(); |
| 112 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); | 109 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); |
| 113 v8SetReturnValueInt(info, impl->doNotCheckSecurityLongAttribute()); | 110 v8SetReturnValueInt(info, impl->doNotCheckSecurityLongAttribute()); |
| 114 } | 111 } |
| 115 | 112 |
| 116 static void doNotCheckSecurityLongAttributeAttributeGetterCallback(const v8::Fun
ctionCallbackInfo<v8::Value>& info) | 113 static void doNotCheckSecurityLongAttributeAttributeGetterCallback(const v8::Fun
ctionCallbackInfo<v8::Value>& info) |
| 117 { | 114 { |
| 118 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttribu
teGetter(info); | 115 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttribu
teGetter(info); |
| 119 } | 116 } |
| 120 | 117 |
| 121 static void doNotCheckSecurityLongAttributeAttributeSetter(v8::Local<v8::Value>
v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) | 118 static void doNotCheckSecurityLongAttributeAttributeSetter(v8::Local<v8::Value>
v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) |
| 122 { | 119 { |
| 123 v8::Local<v8::Object> holder = info.Holder(); | 120 v8::Local<v8::Object> holder = info.Holder(); |
| 124 ExceptionState exceptionState(ExceptionState::SetterContext, "doNotCheckSecu
rityLongAttribute", "TestInterfaceCheckSecurity", holder, info.GetIsolate()); | 121 ExceptionState exceptionState(ExceptionState::SetterContext, "doNotCheckSecu
rityLongAttribute", "TestInterfaceCheckSecurity", holder, info.GetIsolate()); |
| 125 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); | 122 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); |
| 126 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); | 123 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); |
| 127 if (exceptionState.throwIfNeeded()) | 124 if (exceptionState.hadException()) |
| 128 return; | 125 return; |
| 129 impl->setDoNotCheckSecurityLongAttribute(cppValue); | 126 impl->setDoNotCheckSecurityLongAttribute(cppValue); |
| 130 } | 127 } |
| 131 | 128 |
| 132 static void doNotCheckSecurityLongAttributeAttributeSetterCallback(const v8::Fun
ctionCallbackInfo<v8::Value>& info) | 129 static void doNotCheckSecurityLongAttributeAttributeSetterCallback(const v8::Fun
ctionCallbackInfo<v8::Value>& info) |
| 133 { | 130 { |
| 134 v8::Local<v8::Value> v8Value = info[0]; | 131 v8::Local<v8::Value> v8Value = info[0]; |
| 135 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttribu
teSetter(v8Value, info); | 132 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttribu
teSetter(v8Value, info); |
| 136 } | 133 } |
| 137 | 134 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 158 { | 155 { |
| 159 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttribut
eAttributeGetter(info); | 156 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttribut
eAttributeGetter(info); |
| 160 } | 157 } |
| 161 | 158 |
| 162 static void doNotCheckSecurityOnSetterLongAttributeAttributeSetter(v8::Local<v8:
:Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) | 159 static void doNotCheckSecurityOnSetterLongAttributeAttributeSetter(v8::Local<v8:
:Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) |
| 163 { | 160 { |
| 164 v8::Local<v8::Object> holder = info.Holder(); | 161 v8::Local<v8::Object> holder = info.Holder(); |
| 165 ExceptionState exceptionState(ExceptionState::SetterContext, "doNotCheckSecu
rityOnSetterLongAttribute", "TestInterfaceCheckSecurity", holder, info.GetIsolat
e()); | 162 ExceptionState exceptionState(ExceptionState::SetterContext, "doNotCheckSecu
rityOnSetterLongAttribute", "TestInterfaceCheckSecurity", holder, info.GetIsolat
e()); |
| 166 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); | 163 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); |
| 167 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); | 164 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); |
| 168 if (exceptionState.throwIfNeeded()) | 165 if (exceptionState.hadException()) |
| 169 return; | 166 return; |
| 170 impl->setDoNotCheckSecurityOnSetterLongAttribute(cppValue); | 167 impl->setDoNotCheckSecurityOnSetterLongAttribute(cppValue); |
| 171 } | 168 } |
| 172 | 169 |
| 173 static void doNotCheckSecurityOnSetterLongAttributeAttributeSetterCallback(const
v8::FunctionCallbackInfo<v8::Value>& info) | 170 static void doNotCheckSecurityOnSetterLongAttributeAttributeSetterCallback(const
v8::FunctionCallbackInfo<v8::Value>& info) |
| 174 { | 171 { |
| 175 v8::Local<v8::Value> v8Value = info[0]; | 172 v8::Local<v8::Value> v8Value = info[0]; |
| 176 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttribut
eAttributeSetter(v8Value, info); | 173 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttribut
eAttributeSetter(v8Value, info); |
| 177 } | 174 } |
| 178 | 175 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 204 { | 201 { |
| 205 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(acce
ssedObject); | 202 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(acce
ssedObject); |
| 206 return BindingSecurity::shouldAllowAccessTo(toLocalDOMWindow(toDOMWindow(acc
essingContext)), impl, BindingSecurity::ErrorReportOption::DoNotReport); | 203 return BindingSecurity::shouldAllowAccessTo(toLocalDOMWindow(toDOMWindow(acc
essingContext)), impl, BindingSecurity::ErrorReportOption::DoNotReport); |
| 207 } | 204 } |
| 208 | 205 |
| 209 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 206 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 210 { | 207 { |
| 211 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethod"
, "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate()); | 208 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethod"
, "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate()); |
| 212 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info
.Holder()); | 209 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info
.Holder()); |
| 213 if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()
), impl, exceptionState)) { | 210 if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()
), impl, exceptionState)) { |
| 214 exceptionState.throwIfNeeded(); | |
| 215 return; | 211 return; |
| 216 } | 212 } |
| 217 impl->voidMethod(); | 213 impl->voidMethod(); |
| 218 } | 214 } |
| 219 | 215 |
| 220 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) | 216 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 221 { | 217 { |
| 222 TestInterfaceCheckSecurityV8Internal::voidMethodMethod(info); | 218 TestInterfaceCheckSecurityV8Internal::voidMethodMethod(info); |
| 223 } | 219 } |
| 224 | 220 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 { | 378 { |
| 383 if (!name->IsString()) | 379 if (!name->IsString()) |
| 384 return; | 380 return; |
| 385 v8::Local<v8::Object> holder = V8TestInterfaceCheckSecurity::findInstanceInP
rototypeChain(info.Holder(), info.GetIsolate()); | 381 v8::Local<v8::Object> holder = V8TestInterfaceCheckSecurity::findInstanceInP
rototypeChain(info.Holder(), info.GetIsolate()); |
| 386 if (holder.IsEmpty()) | 382 if (holder.IsEmpty()) |
| 387 return; | 383 return; |
| 388 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); | 384 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); |
| 389 v8::String::Utf8Value attributeName(name); | 385 v8::String::Utf8Value attributeName(name); |
| 390 ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName,
"TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate()); | 386 ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName,
"TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate()); |
| 391 if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()
), impl, exceptionState)) { | 387 if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()
), impl, exceptionState)) { |
| 392 exceptionState.throwIfNeeded(); | |
| 393 return; | 388 return; |
| 394 } | 389 } |
| 395 | 390 |
| 396 V8HiddenValue::setHiddenValue(ScriptState::current(info.GetIsolate()), v8::L
ocal<v8::Object>::Cast(info.Holder()), name.As<v8::String>(), v8Value); | 391 V8HiddenValue::setHiddenValue(ScriptState::current(info.GetIsolate()), v8::L
ocal<v8::Object>::Cast(info.Holder()), name.As<v8::String>(), v8Value); |
| 397 } | 392 } |
| 398 | 393 |
| 399 static void TestInterfaceCheckSecurityOriginSafeMethodSetterCallback(v8::Local<v
8::Name> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void
>& info) | 394 static void TestInterfaceCheckSecurityOriginSafeMethodSetterCallback(v8::Local<v
8::Name> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void
>& info) |
| 400 { | 395 { |
| 401 TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMe
thodSetter(name, v8Value, info); | 396 TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMe
thodSetter(name, v8Value, info); |
| 402 } | 397 } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 { | 456 { |
| 462 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); | 457 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); |
| 463 } | 458 } |
| 464 | 459 |
| 465 TestInterfaceCheckSecurity* V8TestInterfaceCheckSecurity::toImplWithTypeCheck(v8
::Isolate* isolate, v8::Local<v8::Value> value) | 460 TestInterfaceCheckSecurity* V8TestInterfaceCheckSecurity::toImplWithTypeCheck(v8
::Isolate* isolate, v8::Local<v8::Value> value) |
| 466 { | 461 { |
| 467 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : nullptr; | 462 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : nullptr; |
| 468 } | 463 } |
| 469 | 464 |
| 470 } // namespace blink | 465 } // namespace blink |
| OLD | NEW |