Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: Source/bindings/tests/results/V8TestInterfaceCheckSecurity.cpp

Issue 350683004: IDL: [Unforgeable] on operation should imply DontDelete+ReadOnly (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/v8/BindingSecurity.h" 10 #include "bindings/v8/BindingSecurity.h"
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 v8SetReturnValue(info, privateTemplate->GetFunction()); 391 v8SetReturnValue(info, privateTemplate->GetFunction());
392 } 392 }
393 393
394 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCa llbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Val ue>& info) 394 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCa llbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Val ue>& info)
395 { 395 {
396 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 396 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
397 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoid MethodOriginSafeMethodGetterForMainWorld(info); 397 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoid MethodOriginSafeMethodGetterForMainWorld(info);
398 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 398 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
399 } 399 }
400 400
401 static void doNotCheckSecurityReadOnlyVoidMethodMethod(const v8::FunctionCallbac kInfo<v8::Value>& info)
402 {
403 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toNative(in fo.Holder());
404 impl->doNotCheckSecurityReadOnlyVoidMethod();
405 }
406
407 static void doNotCheckSecurityReadOnlyVoidMethodMethodCallback(const v8::Functio nCallbackInfo<v8::Value>& info)
408 {
409 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
410 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadOnlyVoidMethodMe thod(info);
411 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
412 }
413
414 static void doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetter(const v8: :PropertyCallbackInfo<v8::Value>& info)
415 {
416 v8::Isolate* isolate = info.GetIsolate();
417 static int domTemplateKey; // This address is used for a key to look up the dom template.
418 V8PerIsolateData* data = V8PerIsolateData::from(isolate);
419 v8::Handle<v8::FunctionTemplate> privateTemplate = data->domTemplate(&domTem plateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadOnlyVoidMe thodMethodCallback, v8Undefined(), v8::Signature::New(isolate, V8TestInterfaceCh eckSecurity::domTemplate(isolate)), 0);
420
421 v8::Handle<v8::Object> holder = V8TestInterfaceCheckSecurity::findInstanceIn PrototypeChain(info.This(), isolate);
422 if (holder.IsEmpty()) {
423 // This is only reachable via |object.__proto__.func|, in which case it
424 // has already passed the same origin security check
425 v8SetReturnValue(info, privateTemplate->GetFunction());
426 return;
427 }
428 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toNative(ho lder);
429 if (!BindingSecurity::shouldAllowAccessToFrame(isolate, impl->frame(), DoNot ReportSecurityError)) {
430 static int sharedTemplateKey; // This address is used for a key to look up the dom template.
431 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->domTemplate(&sha redTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadOnly VoidMethodMethodCallback, v8Undefined(), v8::Signature::New(isolate, V8TestInter faceCheckSecurity::domTemplate(isolate)), 0);
432 v8SetReturnValue(info, sharedTemplate->GetFunction());
433 return;
434 }
435
436 v8::Local<v8::Value> hiddenValue = v8::Handle<v8::Object>::Cast(info.This()) ->GetHiddenValue(v8AtomicString(isolate, "doNotCheckSecurityReadOnlyVoidMethod") );
437 if (!hiddenValue.IsEmpty()) {
438 v8SetReturnValue(info, hiddenValue);
439 return;
440 }
441
442 v8SetReturnValue(info, privateTemplate->GetFunction());
443 }
444
445 static void doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetterCallback(v 8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
446 {
447 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
448 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadOnlyVoidMethodOr iginSafeMethodGetter(info);
449 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
450 }
451
452 static void doNotCheckSecurityUnforgeableVoidMethodMethod(const v8::FunctionCall backInfo<v8::Value>& info) 401 static void doNotCheckSecurityUnforgeableVoidMethodMethod(const v8::FunctionCall backInfo<v8::Value>& info)
453 { 402 {
454 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toNative(in fo.Holder()); 403 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toNative(in fo.Holder());
455 impl->doNotCheckSecurityUnforgeableVoidMethod(); 404 impl->doNotCheckSecurityUnforgeableVoidMethod();
456 } 405 }
457 406
458 static void doNotCheckSecurityUnforgeableVoidMethodMethodCallback(const v8::Func tionCallbackInfo<v8::Value>& info) 407 static void doNotCheckSecurityUnforgeableVoidMethodMethodCallback(const v8::Func tionCallbackInfo<v8::Value>& info)
459 { 408 {
460 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 409 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
461 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMetho dMethod(info); 410 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMetho dMethod(info);
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 }; 505 };
557 V8DOMConfiguration::installAttribute(prototypeTemplate, v8::Handle<v8::Objec tTemplate>(), doNotCheckSecurityVoidMethodOriginSafeAttributeConfiguration, isol ate); 506 V8DOMConfiguration::installAttribute(prototypeTemplate, v8::Handle<v8::Objec tTemplate>(), doNotCheckSecurityVoidMethodOriginSafeAttributeConfiguration, isol ate);
558 static const V8DOMConfiguration::AttributeConfiguration doNotCheckSecurityDo NotCheckSignatureVoidMethodOriginSafeAttributeConfiguration = { 507 static const V8DOMConfiguration::AttributeConfiguration doNotCheckSecurityDo NotCheckSignatureVoidMethodOriginSafeAttributeConfiguration = {
559 "doNotCheckSecurityDoNotCheckSignatureVoidMethod", TestInterfaceCheckSec urityV8Internal::doNotCheckSecurityDoNotCheckSignatureVoidMethodOriginSafeMethod GetterCallback, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurity OriginSafeMethodSetterCallback, 0, 0, &V8TestInterfaceCheckSecurity::wrapperType Info, v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete), fals e 508 "doNotCheckSecurityDoNotCheckSignatureVoidMethod", TestInterfaceCheckSec urityV8Internal::doNotCheckSecurityDoNotCheckSignatureVoidMethodOriginSafeMethod GetterCallback, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurity OriginSafeMethodSetterCallback, 0, 0, &V8TestInterfaceCheckSecurity::wrapperType Info, v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete), fals e
560 }; 509 };
561 V8DOMConfiguration::installAttribute(prototypeTemplate, v8::Handle<v8::Objec tTemplate>(), doNotCheckSecurityDoNotCheckSignatureVoidMethodOriginSafeAttribute Configuration, isolate); 510 V8DOMConfiguration::installAttribute(prototypeTemplate, v8::Handle<v8::Objec tTemplate>(), doNotCheckSecurityDoNotCheckSignatureVoidMethodOriginSafeAttribute Configuration, isolate);
562 static const V8DOMConfiguration::AttributeConfiguration doNotCheckSecurityPe rWorldBindingsVoidMethodOriginSafeAttributeConfiguration = { 511 static const V8DOMConfiguration::AttributeConfiguration doNotCheckSecurityPe rWorldBindingsVoidMethodOriginSafeAttributeConfiguration = {
563 "doNotCheckSecurityPerWorldBindingsVoidMethod", TestInterfaceCheckSecuri tyV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetter Callback, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOrigin SafeMethodSetterCallback, TestInterfaceCheckSecurityV8Internal::doNotCheckSecuri tyPerWorldBindingsVoidMethodOriginSafeMethodGetterCallbackForMainWorld, TestInte rfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCa llbackForMainWorld, &V8TestInterfaceCheckSecurity::wrapperTypeInfo, v8::ALL_CAN_ READ, static_cast<v8::PropertyAttribute>(v8::DontDelete), false 512 "doNotCheckSecurityPerWorldBindingsVoidMethod", TestInterfaceCheckSecuri tyV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetter Callback, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOrigin SafeMethodSetterCallback, TestInterfaceCheckSecurityV8Internal::doNotCheckSecuri tyPerWorldBindingsVoidMethodOriginSafeMethodGetterCallbackForMainWorld, TestInte rfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCa llbackForMainWorld, &V8TestInterfaceCheckSecurity::wrapperTypeInfo, v8::ALL_CAN_ READ, static_cast<v8::PropertyAttribute>(v8::DontDelete), false
564 }; 513 };
565 V8DOMConfiguration::installAttribute(prototypeTemplate, v8::Handle<v8::Objec tTemplate>(), doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeAttributeCon figuration, isolate); 514 V8DOMConfiguration::installAttribute(prototypeTemplate, v8::Handle<v8::Objec tTemplate>(), doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeAttributeCon figuration, isolate);
566 static const V8DOMConfiguration::AttributeConfiguration doNotCheckSecurityRe adOnlyVoidMethodOriginSafeAttributeConfiguration = {
567 "doNotCheckSecurityReadOnlyVoidMethod", TestInterfaceCheckSecurityV8Inte rnal::doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetterCallback, 0, 0, 0, &V8TestInterfaceCheckSecurity::wrapperTypeInfo, v8::ALL_CAN_READ, static_cast <v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly), false
568 };
569 V8DOMConfiguration::installAttribute(prototypeTemplate, v8::Handle<v8::Objec tTemplate>(), doNotCheckSecurityReadOnlyVoidMethodOriginSafeAttributeConfigurati on, isolate);
570 static const V8DOMConfiguration::AttributeConfiguration doNotCheckSecurityUn forgeableVoidMethodOriginSafeAttributeConfiguration = { 515 static const V8DOMConfiguration::AttributeConfiguration doNotCheckSecurityUn forgeableVoidMethodOriginSafeAttributeConfiguration = {
571 "doNotCheckSecurityUnforgeableVoidMethod", TestInterfaceCheckSecurityV8I nternal::doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetterCallback, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethod SetterCallback, 0, 0, &V8TestInterfaceCheckSecurity::wrapperTypeInfo, v8::ALL_CA N_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete), false 516 "doNotCheckSecurityUnforgeableVoidMethod", TestInterfaceCheckSecurityV8I nternal::doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetterCallback, 0, 0, 0, &V8TestInterfaceCheckSecurity::wrapperTypeInfo, v8::ALL_CAN_READ, stati c_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly), false
572 }; 517 };
573 V8DOMConfiguration::installAttribute(instanceTemplate, v8::Handle<v8::Object Template>(), doNotCheckSecurityUnforgeableVoidMethodOriginSafeAttributeConfigura tion, isolate); 518 V8DOMConfiguration::installAttribute(instanceTemplate, v8::Handle<v8::Object Template>(), doNotCheckSecurityUnforgeableVoidMethodOriginSafeAttributeConfigura tion, isolate);
574 519
575 // Custom toString template 520 // Custom toString template
576 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData: :from(isolate)->toStringTemplate()); 521 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData: :from(isolate)->toStringTemplate());
577 } 522 }
578 523
579 v8::Handle<v8::FunctionTemplate> V8TestInterfaceCheckSecurity::domTemplate(v8::I solate* isolate) 524 v8::Handle<v8::FunctionTemplate> V8TestInterfaceCheckSecurity::domTemplate(v8::I solate* isolate)
580 { 525 {
581 return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeI nfo*>(&wrapperTypeInfo), configureV8TestInterfaceCheckSecurityTemplate); 526 return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeI nfo*>(&wrapperTypeInfo), configureV8TestInterfaceCheckSecurityTemplate);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 fromInternalPointer(object)->deref(); 573 fromInternalPointer(object)->deref();
629 } 574 }
630 575
631 template<> 576 template<>
632 v8::Handle<v8::Value> toV8NoInline(TestInterfaceCheckSecurity* impl, v8::Handle< v8::Object> creationContext, v8::Isolate* isolate) 577 v8::Handle<v8::Value> toV8NoInline(TestInterfaceCheckSecurity* impl, v8::Handle< v8::Object> creationContext, v8::Isolate* isolate)
633 { 578 {
634 return toV8(impl, creationContext, isolate); 579 return toV8(impl, creationContext, isolate);
635 } 580 }
636 581
637 } // namespace WebCore 582 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/idls/TestObject.idl ('k') | Source/bindings/tests/results/V8TestObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698