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 // clang-format off | 7 // clang-format off |
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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info
.Holder()); | 245 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info
.Holder()); |
246 | 246 |
247 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterfaceCheckSecurity", "voidMethod"); | 247 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterfaceCheckSecurity", "voidMethod"); |
248 if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()
), impl, exceptionState)) { | 248 if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()
), impl, exceptionState)) { |
249 return; | 249 return; |
250 } | 250 } |
251 | 251 |
252 impl->voidMethod(); | 252 impl->voidMethod(); |
253 } | 253 } |
254 | 254 |
255 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) | 255 void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
256 { | 256 { |
257 TestInterfaceCheckSecurityV8Internal::voidMethodMethod(info); | 257 TestInterfaceCheckSecurityV8Internal::voidMethodMethod(info); |
258 } | 258 } |
259 | 259 |
260 static void doNotCheckSecurityVoidMethodMethod(const v8::FunctionCallbackInfo<v8
::Value>& info) | 260 static void doNotCheckSecurityVoidMethodMethod(const v8::FunctionCallbackInfo<v8
::Value>& info) |
261 { | 261 { |
262 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info
.Holder()); | 262 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info
.Holder()); |
263 | 263 |
264 impl->doNotCheckSecurityVoidMethod(); | 264 impl->doNotCheckSecurityVoidMethod(); |
265 } | 265 } |
266 | 266 |
267 static void doNotCheckSecurityVoidMethodMethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) | 267 void doNotCheckSecurityVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
268 { | 268 { |
269 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodMethod(inf
o); | 269 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodMethod(inf
o); |
270 } | 270 } |
271 | 271 |
272 static void doNotCheckSecurityVoidMethodOriginSafeMethodGetter(const v8::Propert
yCallbackInfo<v8::Value>& info) | 272 static void doNotCheckSecurityVoidMethodOriginSafeMethodGetter(const v8::Propert
yCallbackInfo<v8::Value>& info) |
273 { | 273 { |
274 static int domTemplateKey; // This address is used for a key to look up the
dom template. | 274 static int domTemplateKey; // This address is used for a key to look up the
dom template. |
275 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); | 275 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); |
276 const DOMWrapperWorld& world = DOMWrapperWorld::world(info.GetIsolate()->Get
CurrentContext()); | 276 const DOMWrapperWorld& world = DOMWrapperWorld::world(info.GetIsolate()->Get
CurrentContext()); |
277 v8::Local<v8::FunctionTemplate> interfaceTemplate = data->findInterfaceTempl
ate(world, &V8TestInterfaceCheckSecurity::wrapperTypeInfo); | 277 v8::Local<v8::FunctionTemplate> interfaceTemplate = data->findInterfaceTempl
ate(world, &V8TestInterfaceCheckSecurity::wrapperTypeInfo); |
278 v8::Local<v8::Signature> signature = v8::Signature::New(info.GetIsolate(), i
nterfaceTemplate); | 278 v8::Local<v8::Signature> signature = v8::Signature::New(info.GetIsolate(), i
nterfaceTemplate); |
279 | 279 |
280 v8::Local<v8::FunctionTemplate> methodTemplate = data->findOrCreateOperation
Template(world, &domTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotChec
kSecurityVoidMethodMethodCallback, v8Undefined(), signature, 0); | 280 v8::Local<v8::FunctionTemplate> methodTemplate = data->findOrCreateOperation
Template(world, &domTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotChec
kSecurityVoidMethodMethodCallback, v8Undefined(), signature, 0); |
281 // Return the function by default, unless the user script has overwritten it
. | 281 // Return the function by default, unless the user script has overwritten it
. |
282 v8SetReturnValue(info, methodTemplate->GetFunction(info.GetIsolate()->GetCur
rentContext()).ToLocalChecked()); | 282 v8SetReturnValue(info, methodTemplate->GetFunction(info.GetIsolate()->GetCur
rentContext()).ToLocalChecked()); |
283 | 283 |
284 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info
.Holder()); | 284 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info
.Holder()); |
285 if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()
), impl, BindingSecurity::ErrorReportOption::DoNotReport)) { | 285 if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()
), impl, BindingSecurity::ErrorReportOption::DoNotReport)) { |
286 return; | 286 return; |
287 } | 287 } |
288 | 288 |
289 v8::Local<v8::Value> hiddenValue = V8HiddenValue::getHiddenValue(ScriptState
::current(info.GetIsolate()), v8::Local<v8::Object>::Cast(info.Holder()), v8Atom
icString(info.GetIsolate(), "doNotCheckSecurityVoidMethod")); | 289 v8::Local<v8::Value> hiddenValue = V8HiddenValue::getHiddenValue(ScriptState
::current(info.GetIsolate()), v8::Local<v8::Object>::Cast(info.Holder()), v8Atom
icString(info.GetIsolate(), "doNotCheckSecurityVoidMethod")); |
290 if (!hiddenValue.IsEmpty()) { | 290 if (!hiddenValue.IsEmpty()) { |
291 v8SetReturnValue(info, hiddenValue); | 291 v8SetReturnValue(info, hiddenValue); |
292 } | 292 } |
293 } | 293 } |
294 | 294 |
295 static void doNotCheckSecurityVoidMethodOriginSafeMethodGetterCallback(v8::Local
<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) | 295 void doNotCheckSecurityVoidMethodOriginSafeMethodGetterCallback(v8::Local<v8::Na
me>, const v8::PropertyCallbackInfo<v8::Value>& info) |
296 { | 296 { |
297 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodOriginSafe
MethodGetter(info); | 297 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodOriginSafe
MethodGetter(info); |
298 } | 298 } |
299 | 299 |
300 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethod(const v8::Functio
nCallbackInfo<v8::Value>& info) | 300 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethod(const v8::Functio
nCallbackInfo<v8::Value>& info) |
301 { | 301 { |
302 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info
.Holder()); | 302 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info
.Holder()); |
303 | 303 |
304 impl->doNotCheckSecurityPerWorldBindingsVoidMethod(); | 304 impl->doNotCheckSecurityPerWorldBindingsVoidMethod(); |
305 } | 305 } |
306 | 306 |
307 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallback(const v8:
:FunctionCallbackInfo<v8::Value>& info) | 307 void doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallback(const v8::Functi
onCallbackInfo<v8::Value>& info) |
308 { | 308 { |
309 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoid
MethodMethod(info); | 309 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoid
MethodMethod(info); |
310 } | 310 } |
311 | 311 |
312 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetter(c
onst v8::PropertyCallbackInfo<v8::Value>& info) | 312 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetter(c
onst v8::PropertyCallbackInfo<v8::Value>& info) |
313 { | 313 { |
314 static int domTemplateKey; // This address is used for a key to look up the
dom template. | 314 static int domTemplateKey; // This address is used for a key to look up the
dom template. |
315 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); | 315 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); |
316 const DOMWrapperWorld& world = DOMWrapperWorld::world(info.GetIsolate()->Get
CurrentContext()); | 316 const DOMWrapperWorld& world = DOMWrapperWorld::world(info.GetIsolate()->Get
CurrentContext()); |
317 v8::Local<v8::FunctionTemplate> interfaceTemplate = data->findInterfaceTempl
ate(world, &V8TestInterfaceCheckSecurity::wrapperTypeInfo); | 317 v8::Local<v8::FunctionTemplate> interfaceTemplate = data->findInterfaceTempl
ate(world, &V8TestInterfaceCheckSecurity::wrapperTypeInfo); |
318 v8::Local<v8::Signature> signature = v8::Signature::New(info.GetIsolate(), i
nterfaceTemplate); | 318 v8::Local<v8::Signature> signature = v8::Signature::New(info.GetIsolate(), i
nterfaceTemplate); |
319 | 319 |
320 v8::Local<v8::FunctionTemplate> methodTemplate = data->findOrCreateOperation
Template(world, &domTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotChec
kSecurityPerWorldBindingsVoidMethodMethodCallback, v8Undefined(), signature, 0); | 320 v8::Local<v8::FunctionTemplate> methodTemplate = data->findOrCreateOperation
Template(world, &domTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotChec
kSecurityPerWorldBindingsVoidMethodMethodCallback, v8Undefined(), signature, 0); |
321 // Return the function by default, unless the user script has overwritten it
. | 321 // Return the function by default, unless the user script has overwritten it
. |
322 v8SetReturnValue(info, methodTemplate->GetFunction(info.GetIsolate()->GetCur
rentContext()).ToLocalChecked()); | 322 v8SetReturnValue(info, methodTemplate->GetFunction(info.GetIsolate()->GetCur
rentContext()).ToLocalChecked()); |
323 | 323 |
324 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info
.Holder()); | 324 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info
.Holder()); |
325 if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()
), impl, BindingSecurity::ErrorReportOption::DoNotReport)) { | 325 if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()
), impl, BindingSecurity::ErrorReportOption::DoNotReport)) { |
326 return; | 326 return; |
327 } | 327 } |
328 | 328 |
329 v8::Local<v8::Value> hiddenValue = V8HiddenValue::getHiddenValue(ScriptState
::current(info.GetIsolate()), v8::Local<v8::Object>::Cast(info.Holder()), v8Atom
icString(info.GetIsolate(), "doNotCheckSecurityPerWorldBindingsVoidMethod")); | 329 v8::Local<v8::Value> hiddenValue = V8HiddenValue::getHiddenValue(ScriptState
::current(info.GetIsolate()), v8::Local<v8::Object>::Cast(info.Holder()), v8Atom
icString(info.GetIsolate(), "doNotCheckSecurityPerWorldBindingsVoidMethod")); |
330 if (!hiddenValue.IsEmpty()) { | 330 if (!hiddenValue.IsEmpty()) { |
331 v8SetReturnValue(info, hiddenValue); | 331 v8SetReturnValue(info, hiddenValue); |
332 } | 332 } |
333 } | 333 } |
334 | 334 |
335 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCa
llback(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) | 335 void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallback(
v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) |
336 { | 336 { |
337 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoid
MethodOriginSafeMethodGetter(info); | 337 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoid
MethodOriginSafeMethodGetter(info); |
338 } | 338 } |
339 | 339 |
340 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodForMainWorld(const
v8::FunctionCallbackInfo<v8::Value>& info) | 340 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodForMainWorld(const
v8::FunctionCallbackInfo<v8::Value>& info) |
341 { | 341 { |
342 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info
.Holder()); | 342 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info
.Holder()); |
343 | 343 |
344 impl->doNotCheckSecurityPerWorldBindingsVoidMethod(); | 344 impl->doNotCheckSecurityPerWorldBindingsVoidMethod(); |
345 } | 345 } |
346 | 346 |
347 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWor
ld(const v8::FunctionCallbackInfo<v8::Value>& info) | 347 void doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWorld(cons
t v8::FunctionCallbackInfo<v8::Value>& info) |
348 { | 348 { |
349 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoid
MethodMethodForMainWorld(info); | 349 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoid
MethodMethodForMainWorld(info); |
350 } | 350 } |
351 | 351 |
352 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterFo
rMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) | 352 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterFo
rMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) |
353 { | 353 { |
354 static int domTemplateKey; // This address is used for a key to look up the
dom template. | 354 static int domTemplateKey; // This address is used for a key to look up the
dom template. |
355 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); | 355 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); |
356 const DOMWrapperWorld& world = DOMWrapperWorld::world(info.GetIsolate()->Get
CurrentContext()); | 356 const DOMWrapperWorld& world = DOMWrapperWorld::world(info.GetIsolate()->Get
CurrentContext()); |
357 v8::Local<v8::FunctionTemplate> interfaceTemplate = data->findInterfaceTempl
ate(world, &V8TestInterfaceCheckSecurity::wrapperTypeInfo); | 357 v8::Local<v8::FunctionTemplate> interfaceTemplate = data->findInterfaceTempl
ate(world, &V8TestInterfaceCheckSecurity::wrapperTypeInfo); |
358 v8::Local<v8::Signature> signature = v8::Signature::New(info.GetIsolate(), i
nterfaceTemplate); | 358 v8::Local<v8::Signature> signature = v8::Signature::New(info.GetIsolate(), i
nterfaceTemplate); |
359 | 359 |
360 v8::Local<v8::FunctionTemplate> methodTemplate = data->findOrCreateOperation
Template(world, &domTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotChec
kSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWorld, v8Undefined(), si
gnature, 0); | 360 v8::Local<v8::FunctionTemplate> methodTemplate = data->findOrCreateOperation
Template(world, &domTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotChec
kSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWorld, v8Undefined(), si
gnature, 0); |
361 // Return the function by default, unless the user script has overwritten it
. | 361 // Return the function by default, unless the user script has overwritten it
. |
362 v8SetReturnValue(info, methodTemplate->GetFunction(info.GetIsolate()->GetCur
rentContext()).ToLocalChecked()); | 362 v8SetReturnValue(info, methodTemplate->GetFunction(info.GetIsolate()->GetCur
rentContext()).ToLocalChecked()); |
363 | 363 |
364 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info
.Holder()); | 364 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info
.Holder()); |
365 if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()
), impl, BindingSecurity::ErrorReportOption::DoNotReport)) { | 365 if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()
), impl, BindingSecurity::ErrorReportOption::DoNotReport)) { |
366 return; | 366 return; |
367 } | 367 } |
368 | 368 |
369 v8::Local<v8::Value> hiddenValue = V8HiddenValue::getHiddenValue(ScriptState
::current(info.GetIsolate()), v8::Local<v8::Object>::Cast(info.Holder()), v8Atom
icString(info.GetIsolate(), "doNotCheckSecurityPerWorldBindingsVoidMethod")); | 369 v8::Local<v8::Value> hiddenValue = V8HiddenValue::getHiddenValue(ScriptState
::current(info.GetIsolate()), v8::Local<v8::Object>::Cast(info.Holder()), v8Atom
icString(info.GetIsolate(), "doNotCheckSecurityPerWorldBindingsVoidMethod")); |
370 if (!hiddenValue.IsEmpty()) { | 370 if (!hiddenValue.IsEmpty()) { |
371 v8SetReturnValue(info, hiddenValue); | 371 v8SetReturnValue(info, hiddenValue); |
372 } | 372 } |
373 } | 373 } |
374 | 374 |
375 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCa
llbackForMainWorld(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value
>& info) | 375 void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallbackF
orMainWorld(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info
) |
376 { | 376 { |
377 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoid
MethodOriginSafeMethodGetterForMainWorld(info); | 377 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoid
MethodOriginSafeMethodGetterForMainWorld(info); |
378 } | 378 } |
379 | 379 |
380 static void doNotCheckSecurityUnforgeableVoidMethodMethod(const v8::FunctionCall
backInfo<v8::Value>& info) | 380 static void doNotCheckSecurityUnforgeableVoidMethodMethod(const v8::FunctionCall
backInfo<v8::Value>& info) |
381 { | 381 { |
382 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info
.Holder()); | 382 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info
.Holder()); |
383 | 383 |
384 impl->doNotCheckSecurityUnforgeableVoidMethod(); | 384 impl->doNotCheckSecurityUnforgeableVoidMethod(); |
385 } | 385 } |
386 | 386 |
387 static void doNotCheckSecurityUnforgeableVoidMethodMethodCallback(const v8::Func
tionCallbackInfo<v8::Value>& info) | 387 void doNotCheckSecurityUnforgeableVoidMethodMethodCallback(const v8::FunctionCal
lbackInfo<v8::Value>& info) |
388 { | 388 { |
389 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMetho
dMethod(info); | 389 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMetho
dMethod(info); |
390 } | 390 } |
391 | 391 |
392 static void doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetter(const
v8::PropertyCallbackInfo<v8::Value>& info) | 392 static void doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetter(const
v8::PropertyCallbackInfo<v8::Value>& info) |
393 { | 393 { |
394 static int domTemplateKey; // This address is used for a key to look up the
dom template. | 394 static int domTemplateKey; // This address is used for a key to look up the
dom template. |
395 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); | 395 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); |
396 const DOMWrapperWorld& world = DOMWrapperWorld::world(info.GetIsolate()->Get
CurrentContext()); | 396 const DOMWrapperWorld& world = DOMWrapperWorld::world(info.GetIsolate()->Get
CurrentContext()); |
397 v8::Local<v8::FunctionTemplate> interfaceTemplate = data->findInterfaceTempl
ate(world, &V8TestInterfaceCheckSecurity::wrapperTypeInfo); | 397 v8::Local<v8::FunctionTemplate> interfaceTemplate = data->findInterfaceTempl
ate(world, &V8TestInterfaceCheckSecurity::wrapperTypeInfo); |
398 v8::Local<v8::Signature> signature = v8::Signature::New(info.GetIsolate(), i
nterfaceTemplate); | 398 v8::Local<v8::Signature> signature = v8::Signature::New(info.GetIsolate(), i
nterfaceTemplate); |
399 | 399 |
400 v8::Local<v8::FunctionTemplate> methodTemplate = data->findOrCreateOperation
Template(world, &domTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotChec
kSecurityUnforgeableVoidMethodMethodCallback, v8Undefined(), signature, 0); | 400 v8::Local<v8::FunctionTemplate> methodTemplate = data->findOrCreateOperation
Template(world, &domTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotChec
kSecurityUnforgeableVoidMethodMethodCallback, v8Undefined(), signature, 0); |
401 // Return the function by default, unless the user script has overwritten it
. | 401 // Return the function by default, unless the user script has overwritten it
. |
402 v8SetReturnValue(info, methodTemplate->GetFunction(info.GetIsolate()->GetCur
rentContext()).ToLocalChecked()); | 402 v8SetReturnValue(info, methodTemplate->GetFunction(info.GetIsolate()->GetCur
rentContext()).ToLocalChecked()); |
403 | 403 |
404 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info
.Holder()); | 404 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info
.Holder()); |
405 if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()
), impl, BindingSecurity::ErrorReportOption::DoNotReport)) { | 405 if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()
), impl, BindingSecurity::ErrorReportOption::DoNotReport)) { |
406 return; | 406 return; |
407 } | 407 } |
408 | 408 |
409 v8::Local<v8::Value> hiddenValue = V8HiddenValue::getHiddenValue(ScriptState
::current(info.GetIsolate()), v8::Local<v8::Object>::Cast(info.Holder()), v8Atom
icString(info.GetIsolate(), "doNotCheckSecurityUnforgeableVoidMethod")); | 409 v8::Local<v8::Value> hiddenValue = V8HiddenValue::getHiddenValue(ScriptState
::current(info.GetIsolate()), v8::Local<v8::Object>::Cast(info.Holder()), v8Atom
icString(info.GetIsolate(), "doNotCheckSecurityUnforgeableVoidMethod")); |
410 if (!hiddenValue.IsEmpty()) { | 410 if (!hiddenValue.IsEmpty()) { |
411 v8SetReturnValue(info, hiddenValue); | 411 v8SetReturnValue(info, hiddenValue); |
412 } | 412 } |
413 } | 413 } |
414 | 414 |
415 static void doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetterCallbac
k(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) | 415 void doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetterCallback(v8::L
ocal<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) |
416 { | 416 { |
417 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMetho
dOriginSafeMethodGetter(info); | 417 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMetho
dOriginSafeMethodGetter(info); |
418 } | 418 } |
419 | 419 |
420 static void TestInterfaceCheckSecurityOriginSafeMethodSetter(v8::Local<v8::Name>
name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | 420 static void TestInterfaceCheckSecurityOriginSafeMethodSetter(v8::Local<v8::Name>
name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
421 { | 421 { |
422 if (!name->IsString()) | 422 if (!name->IsString()) |
423 return; | 423 return; |
424 v8::Local<v8::Object> holder = V8TestInterfaceCheckSecurity::findInstanceInP
rototypeChain(info.Holder(), info.GetIsolate()); | 424 v8::Local<v8::Object> holder = V8TestInterfaceCheckSecurity::findInstanceInP
rototypeChain(info.Holder(), info.GetIsolate()); |
425 if (holder.IsEmpty()) | 425 if (holder.IsEmpty()) |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 { | 499 { |
500 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); | 500 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); |
501 } | 501 } |
502 | 502 |
503 TestInterfaceCheckSecurity* V8TestInterfaceCheckSecurity::toImplWithTypeCheck(v8
::Isolate* isolate, v8::Local<v8::Value> value) | 503 TestInterfaceCheckSecurity* V8TestInterfaceCheckSecurity::toImplWithTypeCheck(v8
::Isolate* isolate, v8::Local<v8::Value> value) |
504 { | 504 { |
505 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : nullptr; | 505 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : nullptr; |
506 } | 506 } |
507 | 507 |
508 } // namespace blink | 508 } // namespace blink |
OLD | NEW |