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

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

Issue 2706923002: Rework security checks to be based on Window rather than Frame. (Closed)
Patch Set: Do not hardcode V8Window::wrapperTypeInfo Created 3 years, 7 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. 5 // This file has been auto-generated by code_generator_v8.py.
6 // DO NOT MODIFY! 6 // DO NOT MODIFY!
7 7
8 // This file has been generated from the Jinja2 template in 8 // This file has been generated from the Jinja2 template in
9 // third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl 9 // third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl
10 10
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 437
438 for (const auto& attribute : TestInterfaceCheckSecurityV8Internal::kCrossOrigi nAttributeTable) { 438 for (const auto& attribute : TestInterfaceCheckSecurityV8Internal::kCrossOrigi nAttributeTable) {
439 if (propertyName == attribute.name && attribute.getter) { 439 if (propertyName == attribute.name && attribute.getter) {
440 attribute.getter(info); 440 attribute.getter(info);
441 return; 441 return;
442 } 442 }
443 } 443 }
444 444
445 BindingSecurity::FailedAccessCheckFor( 445 BindingSecurity::FailedAccessCheckFor(
446 info.GetIsolate(), 446 info.GetIsolate(),
447 V8TestInterfaceCheckSecurity::toImpl(info.Holder())->GetFrame()); 447 &V8TestInterfaceCheckSecurity::wrapperTypeInfo,
448 info.Holder());
448 } 449 }
449 450
450 void V8TestInterfaceCheckSecurity::crossOriginNamedSetter(v8::Local<v8::Name> na me, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<v8::Value>& info) { 451 void V8TestInterfaceCheckSecurity::crossOriginNamedSetter(v8::Local<v8::Name> na me, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<v8::Value>& info) {
451 if (!name->IsString()) 452 if (!name->IsString())
452 return; 453 return;
453 const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); 454 const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>());
454 455
455 for (const auto& attribute : TestInterfaceCheckSecurityV8Internal::kCrossOrigi nAttributeTable) { 456 for (const auto& attribute : TestInterfaceCheckSecurityV8Internal::kCrossOrigi nAttributeTable) {
456 if (propertyName == attribute.name && attribute.setter) { 457 if (propertyName == attribute.name && attribute.setter) {
457 attribute.setter(value, V8CrossOriginSetterInfo(info.GetIsolate(), info.Ho lder())); 458 attribute.setter(value, V8CrossOriginSetterInfo(info.GetIsolate(), info.Ho lder()));
458 return; 459 return;
459 } 460 }
460 } 461 }
461 462
462 BindingSecurity::FailedAccessCheckFor( 463 BindingSecurity::FailedAccessCheckFor(
463 info.GetIsolate(), 464 info.GetIsolate(),
464 V8TestInterfaceCheckSecurity::toImpl(info.Holder())->GetFrame()); 465 &V8TestInterfaceCheckSecurity::wrapperTypeInfo,
466 info.Holder());
465 } 467 }
466 468
467 void V8TestInterfaceCheckSecurity::crossOriginNamedEnumerator(const v8::Property CallbackInfo<v8::Array>& info) { 469 void V8TestInterfaceCheckSecurity::crossOriginNamedEnumerator(const v8::Property CallbackInfo<v8::Array>& info) {
468 Vector<String> names; 470 Vector<String> names;
469 for (const auto& attribute : TestInterfaceCheckSecurityV8Internal::kCrossOrigi nAttributeTable) 471 for (const auto& attribute : TestInterfaceCheckSecurityV8Internal::kCrossOrigi nAttributeTable)
470 names.push_back(attribute.name); 472 names.push_back(attribute.name);
471 473
472 // Use the current context as the creation context, as a cross-origin access 474 // Use the current context as the creation context, as a cross-origin access
473 // may involve an object that does not have a creation context. 475 // may involve an object that does not have a creation context.
474 V8SetReturnValue(info, 476 V8SetReturnValue(info,
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 TestInterfaceCheckSecurity* NativeValueTraits<TestInterfaceCheckSecurity>::Nativ eValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& excepti onState) { 575 TestInterfaceCheckSecurity* NativeValueTraits<TestInterfaceCheckSecurity>::Nativ eValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& excepti onState) {
574 TestInterfaceCheckSecurity* nativeValue = V8TestInterfaceCheckSecurity::toImpl WithTypeCheck(isolate, value); 576 TestInterfaceCheckSecurity* nativeValue = V8TestInterfaceCheckSecurity::toImpl WithTypeCheck(isolate, value);
575 if (!nativeValue) { 577 if (!nativeValue) {
576 exceptionState.ThrowTypeError(ExceptionMessages::FailedToConvertJSValue( 578 exceptionState.ThrowTypeError(ExceptionMessages::FailedToConvertJSValue(
577 "TestInterfaceCheckSecurity")); 579 "TestInterfaceCheckSecurity"));
578 } 580 }
579 return nativeValue; 581 return nativeValue;
580 } 582 }
581 583
582 } // namespace blink 584 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl ('k') | third_party/WebKit/Source/core/frame/Location.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698