| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 95 |
| 96 static void doNotCheckSecurityLongAttributeAttributeGetterCallback(v8::Local<v8:
:String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 96 static void doNotCheckSecurityLongAttributeAttributeGetterCallback(v8::Local<v8:
:String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 97 { | 97 { |
| 98 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 98 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 99 TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityLongAttributeAttribu
teGetter(info); | 99 TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityLongAttributeAttribu
teGetter(info); |
| 100 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 100 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 101 } | 101 } |
| 102 | 102 |
| 103 static void doNotCheckSecurityLongAttributeAttributeSetter(v8::Local<v8::Value>
jsValue, const v8::PropertyCallbackInfo<void>& info) | 103 static void doNotCheckSecurityLongAttributeAttributeSetter(v8::Local<v8::Value>
jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 104 { | 104 { |
| 105 ExceptionState exceptionState(ExceptionState::SetterContext, "doNotCheckSecu
rityLongAttribute", "TestCheckSecurityInterface", info.Holder(), info.GetIsolate
()); |
| 105 TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(inf
o.Holder()); | 106 TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(inf
o.Holder()); |
| 106 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); | 107 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| 107 imp->setDoNotCheckSecurityLongAttribute(cppValue); | 108 imp->setDoNotCheckSecurityLongAttribute(cppValue); |
| 108 } | 109 } |
| 109 | 110 |
| 110 static void doNotCheckSecurityLongAttributeAttributeSetterCallback(v8::Local<v8:
:String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& in
fo) | 111 static void doNotCheckSecurityLongAttributeAttributeSetterCallback(v8::Local<v8:
:String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& in
fo) |
| 111 { | 112 { |
| 112 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 113 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 113 TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityLongAttributeAttribu
teSetter(jsValue, info); | 114 TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityLongAttributeAttribu
teSetter(jsValue, info); |
| 114 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 115 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 135 | 136 |
| 136 static void doNotCheckSecurityOnSetterLongAttributeAttributeGetterCallback(v8::L
ocal<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 137 static void doNotCheckSecurityOnSetterLongAttributeAttributeGetterCallback(v8::L
ocal<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 137 { | 138 { |
| 138 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 139 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 139 TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityOnSetterLongAttribut
eAttributeGetter(info); | 140 TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityOnSetterLongAttribut
eAttributeGetter(info); |
| 140 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 141 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 141 } | 142 } |
| 142 | 143 |
| 143 static void doNotCheckSecurityOnSetterLongAttributeAttributeSetter(v8::Local<v8:
:Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 144 static void doNotCheckSecurityOnSetterLongAttributeAttributeSetter(v8::Local<v8:
:Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 144 { | 145 { |
| 146 ExceptionState exceptionState(ExceptionState::SetterContext, "doNotCheckSecu
rityOnSetterLongAttribute", "TestCheckSecurityInterface", info.Holder(), info.Ge
tIsolate()); |
| 145 TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(inf
o.Holder()); | 147 TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(inf
o.Holder()); |
| 146 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); | 148 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| 147 imp->setDoNotCheckSecurityOnSetterLongAttribute(cppValue); | 149 imp->setDoNotCheckSecurityOnSetterLongAttribute(cppValue); |
| 148 } | 150 } |
| 149 | 151 |
| 150 static void doNotCheckSecurityOnSetterLongAttributeAttributeSetterCallback(v8::L
ocal<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v
oid>& info) | 152 static void doNotCheckSecurityOnSetterLongAttributeAttributeSetterCallback(v8::L
ocal<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v
oid>& info) |
| 151 { | 153 { |
| 152 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 154 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 153 TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityOnSetterLongAttribut
eAttributeSetter(jsValue, info); | 155 TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityOnSetterLongAttribut
eAttributeSetter(jsValue, info); |
| 154 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 156 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 155 } | 157 } |
| 156 | 158 |
| 157 bool indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::Access
Type type, v8::Local<v8::Value>) | 159 bool indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::Access
Type type, v8::Local<v8::Value>) |
| 158 { | 160 { |
| 159 TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(ho
st); | 161 TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(ho
st); |
| 160 return BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSe
curityError); | 162 return BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSe
curityError); |
| 161 } | 163 } |
| 162 | 164 |
| 163 bool namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8
::AccessType type, v8::Local<v8::Value>) | 165 bool namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8
::AccessType type, v8::Local<v8::Value>) |
| 164 { | 166 { |
| 165 TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(ho
st); | 167 TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(ho
st); |
| 166 return BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSe
curityError); | 168 return BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSe
curityError); |
| 167 } | 169 } |
| 168 | 170 |
| 169 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 171 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 170 { | 172 { |
| 173 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethod"
, "TestCheckSecurityInterface", info.Holder(), info.GetIsolate()); |
| 171 TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(inf
o.Holder()); | 174 TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(inf
o.Holder()); |
| 172 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | |
| 173 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), exceptionState)
) { | 175 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), exceptionState)
) { |
| 174 exceptionState.throwIfNeeded(); | 176 exceptionState.throwIfNeeded(); |
| 175 return; | 177 return; |
| 176 } | 178 } |
| 177 imp->voidMethod(); | 179 imp->voidMethod(); |
| 178 } | 180 } |
| 179 | 181 |
| 180 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) | 182 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 181 { | 183 { |
| 182 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 184 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 183 TestCheckSecurityInterfaceV8Internal::voidMethodMethod(info); | 185 TestCheckSecurityInterfaceV8Internal::voidMethodMethod(info); |
| 184 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 186 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 185 } | 187 } |
| 186 | 188 |
| 187 static void doNotCheckSecurityVoidMethodMethod(const v8::FunctionCallbackInfo<v8
::Value>& info) | 189 static void doNotCheckSecurityVoidMethodMethod(const v8::FunctionCallbackInfo<v8
::Value>& info) |
| 188 { | 190 { |
| 191 ExceptionState exceptionState(ExceptionState::ExecutionContext, "doNotCheckS
ecurityVoidMethod", "TestCheckSecurityInterface", info.Holder(), info.GetIsolate
()); |
| 189 TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(inf
o.Holder()); | 192 TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(inf
o.Holder()); |
| 190 imp->doNotCheckSecurityVoidMethod(); | 193 imp->doNotCheckSecurityVoidMethod(); |
| 191 } | 194 } |
| 192 | 195 |
| 193 static void doNotCheckSecurityVoidMethodMethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) | 196 static void doNotCheckSecurityVoidMethodMethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) |
| 194 { | 197 { |
| 195 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 198 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 196 TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityVoidMethodMethod(inf
o); | 199 TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityVoidMethodMethod(inf
o); |
| 197 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 200 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 198 } | 201 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 | 234 |
| 232 static void doNotCheckSecurityVoidMethodOriginSafeMethodGetterCallback(v8::Local
<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 235 static void doNotCheckSecurityVoidMethodOriginSafeMethodGetterCallback(v8::Local
<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 233 { | 236 { |
| 234 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 237 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 235 TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityVoidMethodOriginSafe
MethodGetter(info); | 238 TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityVoidMethodOriginSafe
MethodGetter(info); |
| 236 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 239 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 237 } | 240 } |
| 238 | 241 |
| 239 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethod(const v8::Functio
nCallbackInfo<v8::Value>& info) | 242 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethod(const v8::Functio
nCallbackInfo<v8::Value>& info) |
| 240 { | 243 { |
| 244 ExceptionState exceptionState(ExceptionState::ExecutionContext, "doNotCheckS
ecurityPerWorldBindingsVoidMethod", "TestCheckSecurityInterface", info.Holder(),
info.GetIsolate()); |
| 241 TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(inf
o.Holder()); | 245 TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(inf
o.Holder()); |
| 242 imp->doNotCheckSecurityPerWorldBindingsVoidMethod(); | 246 imp->doNotCheckSecurityPerWorldBindingsVoidMethod(); |
| 243 } | 247 } |
| 244 | 248 |
| 245 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallback(const v8:
:FunctionCallbackInfo<v8::Value>& info) | 249 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallback(const v8:
:FunctionCallbackInfo<v8::Value>& info) |
| 246 { | 250 { |
| 247 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 251 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 248 TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityPerWorldBindingsVoid
MethodMethod(info); | 252 TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityPerWorldBindingsVoid
MethodMethod(info); |
| 249 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 253 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 250 } | 254 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 | 287 |
| 284 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCa
llback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 288 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCa
llback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 285 { | 289 { |
| 286 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 290 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 287 TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityPerWorldBindingsVoid
MethodOriginSafeMethodGetter(info); | 291 TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityPerWorldBindingsVoid
MethodOriginSafeMethodGetter(info); |
| 288 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 292 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 289 } | 293 } |
| 290 | 294 |
| 291 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodForMainWorld(const
v8::FunctionCallbackInfo<v8::Value>& info) | 295 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodForMainWorld(const
v8::FunctionCallbackInfo<v8::Value>& info) |
| 292 { | 296 { |
| 297 ExceptionState exceptionState(ExceptionState::ExecutionContext, "doNotCheckS
ecurityPerWorldBindingsVoidMethod", "TestCheckSecurityInterface", info.Holder(),
info.GetIsolate()); |
| 293 TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(inf
o.Holder()); | 298 TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(inf
o.Holder()); |
| 294 imp->doNotCheckSecurityPerWorldBindingsVoidMethod(); | 299 imp->doNotCheckSecurityPerWorldBindingsVoidMethod(); |
| 295 } | 300 } |
| 296 | 301 |
| 297 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWor
ld(const v8::FunctionCallbackInfo<v8::Value>& info) | 302 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWor
ld(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 298 { | 303 { |
| 299 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 304 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 300 TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityPerWorldBindingsVoid
MethodMethodForMainWorld(info); | 305 TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityPerWorldBindingsVoid
MethodMethodForMainWorld(info); |
| 301 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 306 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 302 } | 307 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 | 340 |
| 336 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCa
llbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Val
ue>& info) | 341 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCa
llbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Val
ue>& info) |
| 337 { | 342 { |
| 338 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 343 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 339 TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityPerWorldBindingsVoid
MethodOriginSafeMethodGetterForMainWorld(info); | 344 TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityPerWorldBindingsVoid
MethodOriginSafeMethodGetterForMainWorld(info); |
| 340 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 345 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 341 } | 346 } |
| 342 | 347 |
| 343 static void doNotCheckSecurityReadOnlyVoidMethodMethod(const v8::FunctionCallbac
kInfo<v8::Value>& info) | 348 static void doNotCheckSecurityReadOnlyVoidMethodMethod(const v8::FunctionCallbac
kInfo<v8::Value>& info) |
| 344 { | 349 { |
| 350 ExceptionState exceptionState(ExceptionState::ExecutionContext, "doNotCheckS
ecurityReadOnlyVoidMethod", "TestCheckSecurityInterface", info.Holder(), info.Ge
tIsolate()); |
| 345 TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(inf
o.Holder()); | 351 TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(inf
o.Holder()); |
| 346 imp->doNotCheckSecurityReadOnlyVoidMethod(); | 352 imp->doNotCheckSecurityReadOnlyVoidMethod(); |
| 347 } | 353 } |
| 348 | 354 |
| 349 static void doNotCheckSecurityReadOnlyVoidMethodMethodCallback(const v8::Functio
nCallbackInfo<v8::Value>& info) | 355 static void doNotCheckSecurityReadOnlyVoidMethodMethodCallback(const v8::Functio
nCallbackInfo<v8::Value>& info) |
| 350 { | 356 { |
| 351 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 357 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 352 TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityReadOnlyVoidMethodMe
thod(info); | 358 TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityReadOnlyVoidMethodMe
thod(info); |
| 353 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 359 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 354 } | 360 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 | 393 |
| 388 static void doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetterCallback(v
8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 394 static void doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetterCallback(v
8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 389 { | 395 { |
| 390 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 396 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 391 TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityReadOnlyVoidMethodOr
iginSafeMethodGetter(info); | 397 TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityReadOnlyVoidMethodOr
iginSafeMethodGetter(info); |
| 392 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 398 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 393 } | 399 } |
| 394 | 400 |
| 395 static void doNotCheckSecurityUnforgeableVoidMethodMethod(const v8::FunctionCall
backInfo<v8::Value>& info) | 401 static void doNotCheckSecurityUnforgeableVoidMethodMethod(const v8::FunctionCall
backInfo<v8::Value>& info) |
| 396 { | 402 { |
| 403 ExceptionState exceptionState(ExceptionState::ExecutionContext, "doNotCheckS
ecurityUnforgeableVoidMethod", "TestCheckSecurityInterface", info.Holder(), info
.GetIsolate()); |
| 397 TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(inf
o.Holder()); | 404 TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(inf
o.Holder()); |
| 398 imp->doNotCheckSecurityUnforgeableVoidMethod(); | 405 imp->doNotCheckSecurityUnforgeableVoidMethod(); |
| 399 } | 406 } |
| 400 | 407 |
| 401 static void doNotCheckSecurityUnforgeableVoidMethodMethodCallback(const v8::Func
tionCallbackInfo<v8::Value>& info) | 408 static void doNotCheckSecurityUnforgeableVoidMethodMethodCallback(const v8::Func
tionCallbackInfo<v8::Value>& info) |
| 402 { | 409 { |
| 403 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 410 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 404 TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityUnforgeableVoidMetho
dMethod(info); | 411 TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityUnforgeableVoidMetho
dMethod(info); |
| 405 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 412 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 406 } | 413 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityUnforgeableVoidMetho
dOriginSafeMethodGetter(info); | 450 TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityUnforgeableVoidMetho
dOriginSafeMethodGetter(info); |
| 444 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 451 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 445 } | 452 } |
| 446 | 453 |
| 447 static void TestCheckSecurityInterfaceOriginSafeMethodSetter(v8::Local<v8::Strin
g> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& inf
o) | 454 static void TestCheckSecurityInterfaceOriginSafeMethodSetter(v8::Local<v8::Strin
g> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& inf
o) |
| 448 { | 455 { |
| 449 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8
TestCheckSecurityInterface::GetTemplate(info.GetIsolate(), worldType(info.GetIso
late()))); | 456 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8
TestCheckSecurityInterface::GetTemplate(info.GetIsolate(), worldType(info.GetIso
late()))); |
| 450 if (holder.IsEmpty()) | 457 if (holder.IsEmpty()) |
| 451 return; | 458 return; |
| 452 TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(hol
der); | 459 TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(hol
der); |
| 453 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | 460 ExceptionState exceptionState(ExceptionState::SetterContext, *v8::String::Ut
f8Value(name), "TestCheckSecurityInterface", info.Holder(), info.GetIsolate()); |
| 454 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), exceptionState)
) { | 461 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), exceptionState)
) { |
| 455 exceptionState.throwIfNeeded(); | 462 exceptionState.throwIfNeeded(); |
| 456 return; | 463 return; |
| 457 } | 464 } |
| 458 | 465 |
| 459 info.This()->SetHiddenValue(name, jsValue); | 466 info.This()->SetHiddenValue(name, jsValue); |
| 460 } | 467 } |
| 461 | 468 |
| 462 static void TestCheckSecurityInterfaceOriginSafeMethodSetterCallback(v8::Local<v
8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<vo
id>& info) | 469 static void TestCheckSecurityInterfaceOriginSafeMethodSetterCallback(v8::Local<v
8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<vo
id>& info) |
| 463 { | 470 { |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 fromInternalPointer(object)->deref(); | 568 fromInternalPointer(object)->deref(); |
| 562 } | 569 } |
| 563 | 570 |
| 564 template<> | 571 template<> |
| 565 v8::Handle<v8::Value> toV8NoInline(TestCheckSecurityInterface* impl, v8::Handle<
v8::Object> creationContext, v8::Isolate* isolate) | 572 v8::Handle<v8::Value> toV8NoInline(TestCheckSecurityInterface* impl, v8::Handle<
v8::Object> creationContext, v8::Isolate* isolate) |
| 566 { | 573 { |
| 567 return toV8(impl, creationContext, isolate); | 574 return toV8(impl, creationContext, isolate); |
| 568 } | 575 } |
| 569 | 576 |
| 570 } // namespace WebCore | 577 } // namespace WebCore |
| OLD | NEW |