| 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 "V8TestInterfaceCheckSecurity.h" | 8 #include "V8TestInterfaceCheckSecurity.h" |
| 9 | 9 |
| 10 #include "bindings/core/v8/BindingSecurity.h" | 10 #include "bindings/core/v8/BindingSecurity.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 const WrapperTypeInfo V8TestInterfaceCheckSecurity::wrapperTypeInfo = { gin::kEm
bedderBlink, V8TestInterfaceCheckSecurity::domTemplate, V8TestInterfaceCheckSecu
rity::refObject, V8TestInterfaceCheckSecurity::derefObject, V8TestInterfaceCheck
Security::trace, 0, 0, V8TestInterfaceCheckSecurity::preparePrototypeObject, V8T
estInterfaceCheckSecurity::installConditionallyEnabledProperties, "TestInterface
CheckSecurity", 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo:
:ObjectClassId, WrapperTypeInfo::NotInheritFromEventTarget, WrapperTypeInfo::Ind
ependent, WrapperTypeInfo::RefCountedObject }; | 23 const WrapperTypeInfo V8TestInterfaceCheckSecurity::wrapperTypeInfo = { gin::kEm
bedderBlink, V8TestInterfaceCheckSecurity::domTemplate, V8TestInterfaceCheckSecu
rity::refObject, V8TestInterfaceCheckSecurity::derefObject, V8TestInterfaceCheck
Security::trace, 0, 0, V8TestInterfaceCheckSecurity::preparePrototypeObject, V8T
estInterfaceCheckSecurity::installConditionallyEnabledProperties, "TestInterface
CheckSecurity", 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo:
:ObjectClassId, WrapperTypeInfo::NotInheritFromEventTarget, WrapperTypeInfo::Ind
ependent, WrapperTypeInfo::RefCountedObject }; |
| 24 | 24 |
| 25 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac
eCheckSecurity.h. | 25 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac
eCheckSecurity.h. |
| 26 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in | 26 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in |
| 27 // bindings/core/v8/ScriptWrappable.h. | 27 // bindings/core/v8/ScriptWrappable.h. |
| 28 const WrapperTypeInfo& TestInterfaceCheckSecurity::s_wrapperTypeInfo = V8TestInt
erfaceCheckSecurity::wrapperTypeInfo; | 28 const WrapperTypeInfo& TestInterfaceCheckSecurity::s_wrapperTypeInfo = V8TestInt
erfaceCheckSecurity::wrapperTypeInfo; |
| 29 | 29 |
| 30 namespace TestInterfaceCheckSecurityV8Internal { | 30 namespace TestInterfaceCheckSecurityV8Internal { |
| 31 | 31 |
| 32 template<class CallbackInfo> | 32 template<class CallbackInfo> |
| 33 static void TestInterfaceCheckSecurityForceSetAttributeOnThis(v8::Local<v8::Name
> name, v8::Local<v8::Value> v8Value, const CallbackInfo& info) | 33 static bool TestInterfaceCheckSecurityCreateDataProperty(v8::Local<v8::Name> nam
e, v8::Local<v8::Value> v8Value, const CallbackInfo& info) |
| 34 { | 34 { |
| 35 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info
.Holder()); | 35 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info
.Holder()); |
| 36 v8::String::Utf8Value attributeName(name); | 36 v8::String::Utf8Value attributeName(name); |
| 37 ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName,
"TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate()); | 37 ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName,
"TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate()); |
| 38 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram
e(), exceptionState)) { | 38 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram
e(), exceptionState)) { |
| 39 exceptionState.throwIfNeeded(); | 39 exceptionState.throwIfNeeded(); |
| 40 return; | 40 return false; |
| 41 } | 41 } |
| 42 ASSERT(info.This()->IsObject()); | 42 ASSERT(info.This()->IsObject()); |
| 43 v8::Local<v8::Object>::Cast(info.This())->ForceSet(info.GetIsolate()->GetCur
rentContext(), name, v8Value); | 43 return v8CallBoolean(v8::Local<v8::Object>::Cast(info.This())->CreateDataPro
perty(info.GetIsolate()->GetCurrentContext(), name, v8Value)); |
| 44 } | 44 } |
| 45 | 45 |
| 46 static void readonlyLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<
v8::Value>& info) | 46 static void readonlyLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<
v8::Value>& info) |
| 47 { | 47 { |
| 48 v8::Local<v8::Object> holder = info.Holder(); | 48 v8::Local<v8::Object> holder = info.Holder(); |
| 49 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); | 49 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); |
| 50 ExceptionState exceptionState(ExceptionState::GetterContext, "readonlyLongAt
tribute", "TestInterfaceCheckSecurity", holder, info.GetIsolate()); | 50 ExceptionState exceptionState(ExceptionState::GetterContext, "readonlyLongAt
tribute", "TestInterfaceCheckSecurity", holder, info.GetIsolate()); |
| 51 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram
e(), exceptionState)) { | 51 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram
e(), exceptionState)) { |
| 52 v8SetReturnValueNull(info); | 52 v8SetReturnValueNull(info); |
| 53 exceptionState.throwIfNeeded(); | 53 exceptionState.throwIfNeeded(); |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetterCal
lback(const v8::FunctionCallbackInfo<v8::Value>& info) | 197 static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetterCal
lback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 198 { | 198 { |
| 199 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | 199 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
| 200 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReplaceableReadonlyL
ongAttributeAttributeGetter(info); | 200 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReplaceableReadonlyL
ongAttributeAttributeGetter(info); |
| 201 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 201 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 202 } | 202 } |
| 203 | 203 |
| 204 static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeSetter(v8
::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) | 204 static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeSetter(v8
::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) |
| 205 { | 205 { |
| 206 v8::Local<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "doNo
tCheckSecurityReplaceableReadonlyLongAttribute"); | 206 v8::Local<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "doNo
tCheckSecurityReplaceableReadonlyLongAttribute"); |
| 207 TestInterfaceCheckSecurityForceSetAttributeOnThis(propertyName, v8Value, inf
o); | 207 TestInterfaceCheckSecurityCreateDataProperty(propertyName, v8Value, info); |
| 208 } | 208 } |
| 209 | 209 |
| 210 static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeSetterCal
lback(const v8::FunctionCallbackInfo<v8::Value>& info) | 210 static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeSetterCal
lback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 211 { | 211 { |
| 212 v8::Local<v8::Value> v8Value = info[0]; | 212 v8::Local<v8::Value> v8Value = info[0]; |
| 213 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | 213 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
| 214 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReplaceableReadonlyL
ongAttributeAttributeSetter(v8Value, info); | 214 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReplaceableReadonlyL
ongAttributeAttributeSetter(v8Value, info); |
| 215 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 215 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 216 } | 216 } |
| 217 | 217 |
| 218 static void doNotCheckSecurityReplaceableReadonlyLongAccessorAttributeGetter(con
st v8::FunctionCallbackInfo<v8::Value>& info) | 218 static void doNotCheckSecurityReplaceableReadonlyLongAccessorAttributeGetter(con
st v8::FunctionCallbackInfo<v8::Value>& info) |
| 219 { | 219 { |
| 220 v8::Local<v8::Object> holder = info.Holder(); | 220 v8::Local<v8::Object> holder = info.Holder(); |
| 221 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); | 221 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold
er); |
| 222 v8SetReturnValueInt(info, impl->doNotCheckSecurityReplaceableReadonlyLongAcc
essor()); | 222 v8SetReturnValueInt(info, impl->doNotCheckSecurityReplaceableReadonlyLongAcc
essor()); |
| 223 } | 223 } |
| 224 | 224 |
| 225 static void doNotCheckSecurityReplaceableReadonlyLongAccessorAttributeGetterCall
back(const v8::FunctionCallbackInfo<v8::Value>& info) | 225 static void doNotCheckSecurityReplaceableReadonlyLongAccessorAttributeGetterCall
back(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 226 { | 226 { |
| 227 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | 227 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
| 228 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReplaceableReadonlyL
ongAccessorAttributeGetter(info); | 228 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReplaceableReadonlyL
ongAccessorAttributeGetter(info); |
| 229 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 229 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 230 } | 230 } |
| 231 | 231 |
| 232 static void doNotCheckSecurityReplaceableReadonlyLongAccessorAttributeSetter(v8:
:Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) | 232 static void doNotCheckSecurityReplaceableReadonlyLongAccessorAttributeSetter(v8:
:Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) |
| 233 { | 233 { |
| 234 v8::Local<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "doNo
tCheckSecurityReplaceableReadonlyLongAccessor"); | 234 v8::Local<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "doNo
tCheckSecurityReplaceableReadonlyLongAccessor"); |
| 235 TestInterfaceCheckSecurityForceSetAttributeOnThis(propertyName, v8Value, inf
o); | 235 TestInterfaceCheckSecurityCreateDataProperty(propertyName, v8Value, info); |
| 236 } | 236 } |
| 237 | 237 |
| 238 static void doNotCheckSecurityReplaceableReadonlyLongAccessorAttributeSetterCall
back(const v8::FunctionCallbackInfo<v8::Value>& info) | 238 static void doNotCheckSecurityReplaceableReadonlyLongAccessorAttributeSetterCall
back(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 239 { | 239 { |
| 240 v8::Local<v8::Value> v8Value = info[0]; | 240 v8::Local<v8::Value> v8Value = info[0]; |
| 241 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | 241 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
| 242 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReplaceableReadonlyL
ongAccessorAttributeSetter(v8Value, info); | 242 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReplaceableReadonlyL
ongAccessorAttributeSetter(v8Value, info); |
| 243 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 243 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 244 } | 244 } |
| 245 | 245 |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 { | 621 { |
| 622 scriptWrappable->toImpl<TestInterfaceCheckSecurity>()->ref(); | 622 scriptWrappable->toImpl<TestInterfaceCheckSecurity>()->ref(); |
| 623 } | 623 } |
| 624 | 624 |
| 625 void V8TestInterfaceCheckSecurity::derefObject(ScriptWrappable* scriptWrappable) | 625 void V8TestInterfaceCheckSecurity::derefObject(ScriptWrappable* scriptWrappable) |
| 626 { | 626 { |
| 627 scriptWrappable->toImpl<TestInterfaceCheckSecurity>()->deref(); | 627 scriptWrappable->toImpl<TestInterfaceCheckSecurity>()->deref(); |
| 628 } | 628 } |
| 629 | 629 |
| 630 } // namespace blink | 630 } // namespace blink |
| OLD | NEW |