| Index: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp
|
| diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp
|
| index 567f696f54355948cf760746dc65302d709e2f10..4c2cdbed8a788a089aca008bf418862d2063a68c 100644
|
| --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp
|
| +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp
|
| @@ -52,12 +52,16 @@ namespace TestInterfaceCheckSecurityV8Internal {
|
| static void readonlyLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| {
|
| v8::Local<v8::Object> holder = info.Holder();
|
| +
|
| TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(holder);
|
| - ExceptionState exceptionState(ExceptionState::GetterContext, "readonlyLongAttribute", "TestInterfaceCheckSecurity", holder, info.GetIsolate());
|
| +
|
| + // Perform a security check for the receiver object.
|
| + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::GetterContext, "TestInterfaceCheckSecurity", "readonlyLongAttribute");
|
| if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()), impl, exceptionState)) {
|
| v8SetReturnValueNull(info);
|
| return;
|
| }
|
| +
|
| v8SetReturnValueInt(info, impl->readonlyLongAttribute());
|
| }
|
|
|
| @@ -69,12 +73,16 @@ void readonlyLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo
|
| static void longAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| {
|
| v8::Local<v8::Object> holder = info.Holder();
|
| +
|
| TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(holder);
|
| - ExceptionState exceptionState(ExceptionState::GetterContext, "longAttribute", "TestInterfaceCheckSecurity", holder, info.GetIsolate());
|
| +
|
| + // Perform a security check for the receiver object.
|
| + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::GetterContext, "TestInterfaceCheckSecurity", "longAttribute");
|
| if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()), impl, exceptionState)) {
|
| v8SetReturnValueNull(info);
|
| return;
|
| }
|
| +
|
| v8SetReturnValueInt(info, impl->longAttribute());
|
| }
|
|
|
| @@ -86,28 +94,36 @@ void longAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Val
|
| static void longAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
|
| {
|
| v8::Local<v8::Object> holder = info.Holder();
|
| - ExceptionState exceptionState(ExceptionState::SetterContext, "longAttribute", "TestInterfaceCheckSecurity", holder, info.GetIsolate());
|
| TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(holder);
|
| +
|
| + // Perform a security check for the receiver object.
|
| + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "TestInterfaceCheckSecurity", "longAttribute");
|
| if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()), impl, exceptionState)) {
|
| v8SetReturnValue(info, v8Value);
|
| return;
|
| }
|
| +
|
| + // Prepare the value to be set.
|
| int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
|
| if (exceptionState.hadException())
|
| return;
|
| +
|
| impl->setLongAttribute(cppValue);
|
| }
|
|
|
| void longAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| {
|
| v8::Local<v8::Value> v8Value = info[0];
|
| +
|
| TestInterfaceCheckSecurityV8Internal::longAttributeAttributeSetter(v8Value, info);
|
| }
|
|
|
| static void doNotCheckSecurityLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| {
|
| v8::Local<v8::Object> holder = info.Holder();
|
| +
|
| TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(holder);
|
| +
|
| v8SetReturnValueInt(info, impl->doNotCheckSecurityLongAttribute());
|
| }
|
|
|
| @@ -119,24 +135,31 @@ void doNotCheckSecurityLongAttributeAttributeGetterCallback(const v8::FunctionCa
|
| static void doNotCheckSecurityLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
|
| {
|
| v8::Local<v8::Object> holder = info.Holder();
|
| - ExceptionState exceptionState(ExceptionState::SetterContext, "doNotCheckSecurityLongAttribute", "TestInterfaceCheckSecurity", holder, info.GetIsolate());
|
| TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(holder);
|
| +
|
| + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "TestInterfaceCheckSecurity", "doNotCheckSecurityLongAttribute");
|
| +
|
| + // Prepare the value to be set.
|
| int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
|
| if (exceptionState.hadException())
|
| return;
|
| +
|
| impl->setDoNotCheckSecurityLongAttribute(cppValue);
|
| }
|
|
|
| void doNotCheckSecurityLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| {
|
| v8::Local<v8::Value> v8Value = info[0];
|
| +
|
| TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttributeSetter(v8Value, info);
|
| }
|
|
|
| static void doNotCheckSecurityReadonlyLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| {
|
| v8::Local<v8::Object> holder = info.Holder();
|
| +
|
| TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(holder);
|
| +
|
| v8SetReturnValueInt(info, impl->doNotCheckSecurityReadonlyLongAttribute());
|
| }
|
|
|
| @@ -148,7 +171,9 @@ void doNotCheckSecurityReadonlyLongAttributeAttributeGetterCallback(const v8::Fu
|
| static void doNotCheckSecurityOnSetterLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| {
|
| v8::Local<v8::Object> holder = info.Holder();
|
| +
|
| TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(holder);
|
| +
|
| v8SetReturnValueInt(info, impl->doNotCheckSecurityOnSetterLongAttribute());
|
| }
|
|
|
| @@ -160,24 +185,31 @@ void doNotCheckSecurityOnSetterLongAttributeAttributeGetterCallback(const v8::Fu
|
| static void doNotCheckSecurityOnSetterLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
|
| {
|
| v8::Local<v8::Object> holder = info.Holder();
|
| - ExceptionState exceptionState(ExceptionState::SetterContext, "doNotCheckSecurityOnSetterLongAttribute", "TestInterfaceCheckSecurity", holder, info.GetIsolate());
|
| TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(holder);
|
| +
|
| + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "TestInterfaceCheckSecurity", "doNotCheckSecurityOnSetterLongAttribute");
|
| +
|
| + // Prepare the value to be set.
|
| int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
|
| if (exceptionState.hadException())
|
| return;
|
| +
|
| impl->setDoNotCheckSecurityOnSetterLongAttribute(cppValue);
|
| }
|
|
|
| void doNotCheckSecurityOnSetterLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| {
|
| v8::Local<v8::Value> v8Value = info[0];
|
| +
|
| TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttributeAttributeSetter(v8Value, info);
|
| }
|
|
|
| static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| {
|
| v8::Local<v8::Object> holder = info.Holder();
|
| +
|
| TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(holder);
|
| +
|
| v8SetReturnValueInt(info, impl->doNotCheckSecurityReplaceableReadonlyLongAttribute());
|
| }
|
|
|
| @@ -188,6 +220,8 @@ void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetterCallback(c
|
|
|
| static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
|
| {
|
| + // Prepare the value to be set.
|
| +
|
| v8::Local<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "doNotCheckSecurityReplaceableReadonlyLongAttribute");
|
| v8CallBoolean(info.Holder()->CreateDataProperty(info.GetIsolate()->GetCurrentContext(), propertyName, v8Value));
|
| }
|
| @@ -195,6 +229,7 @@ static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeSetter(v8
|
| void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| {
|
| v8::Local<v8::Value> v8Value = info[0];
|
| +
|
| TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeSetter(v8Value, info);
|
| }
|
|
|
|
|