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

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

Issue 953473002: bindings: Supports [Replaceable] accessors. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
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/core/v8/BindingSecurity.h" 10 #include "bindings/core/v8/BindingSecurity.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 v8SetReturnValueInt(info, impl->doNotCheckSecurityReplaceableReadonlyLongAtt ribute()); 125 v8SetReturnValueInt(info, impl->doNotCheckSecurityReplaceableReadonlyLongAtt ribute());
126 } 126 }
127 127
128 static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetterCal lback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 128 static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetterCal lback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
129 { 129 {
130 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 130 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
131 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReplaceableReadonlyL ongAttributeAttributeGetter(info); 131 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReplaceableReadonlyL ongAttributeAttributeGetter(info);
132 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 132 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
133 } 133 }
134 134
135 static void doNotCheckSecurityReplaceableReadonlyLongAccessorAttributeGetter(con st v8::FunctionCallbackInfo<v8::Value>& info)
136 {
137 v8::Local<v8::Object> holder = info.Holder();
138 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(hold er);
139 v8SetReturnValueInt(info, impl->doNotCheckSecurityReplaceableReadonlyLongAcc essor());
140 }
141
142 static void doNotCheckSecurityReplaceableReadonlyLongAccessorAttributeGetterCall back(const v8::FunctionCallbackInfo<v8::Value>& info)
143 {
144 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
145 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReplaceableReadonlyL ongAccessorAttributeGetter(info);
146 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
147 }
148
149 static void doNotCheckSecurityReplaceableReadonlyLongAccessorAttributeSetter(v8: :Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
150 {
151 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info .Holder());
152 ExceptionState exceptionState(ExceptionState::SetterContext, "doNotCheckSecu rityReplaceableReadonlyLongAccessor", "TestInterfaceCheckSecurity", info.Holder( ), info.GetIsolate());
153 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram e(), exceptionState)) {
154 exceptionState.throwIfNeeded();
155 return;
156 }
157 if (info.This()->IsObject()) {
158 v8::Local<v8::String> propertyName = v8AtomicString(info.GetIsolate(), " doNotCheckSecurityReplaceableReadonlyLongAccessor");
159 v8::Local<v8::Object>::Cast(info.This())->ForceSet(propertyName, v8Value );
160 }
161 }
162
163 static void doNotCheckSecurityReplaceableReadonlyLongAccessorAttributeSetterCall back(const v8::FunctionCallbackInfo<v8::Value>& info)
164 {
165 v8::Local<v8::Value> v8Value = info[0];
166 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
167 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReplaceableReadonlyL ongAccessorAttributeSetter(v8Value, info);
168 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
169 }
170
135 static void TestInterfaceCheckSecurityForceSetAttributeOnThis(v8::Local<v8::Stri ng> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& in fo) 171 static void TestInterfaceCheckSecurityForceSetAttributeOnThis(v8::Local<v8::Stri ng> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& in fo)
136 { 172 {
137 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info .Holder()); 173 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info .Holder());
138 v8::String::Utf8Value attributeName(name); 174 v8::String::Utf8Value attributeName(name);
139 ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName, "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate()); 175 ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName, "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate());
140 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram e(), exceptionState)) { 176 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram e(), exceptionState)) {
141 exceptionState.throwIfNeeded(); 177 exceptionState.throwIfNeeded();
142 return; 178 return;
143 } 179 }
144 if (info.This()->IsObject()) 180 if (info.This()->IsObject())
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 } // namespace TestInterfaceCheckSecurityV8Internal 492 } // namespace TestInterfaceCheckSecurityV8Internal
457 493
458 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceCheckSecu rityAttributes[] = { 494 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceCheckSecu rityAttributes[] = {
459 {"longAttribute", TestInterfaceCheckSecurityV8Internal::longAttributeAttribu teGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), stati c_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts , V8DOMConfiguration::OnInstance}, 495 {"longAttribute", TestInterfaceCheckSecurityV8Internal::longAttributeAttribu teGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), stati c_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts , V8DOMConfiguration::OnInstance},
460 {"doNotCheckSecurityLongAttribute", TestInterfaceCheckSecurityV8Internal::do NotCheckSecurityLongAttributeAttributeGetterCallback, TestInterfaceCheckSecurity V8Internal::doNotCheckSecurityLongAttributeAttributeSetterCallback, 0, 0, 0, sta tic_cast<v8::AccessControl>(v8::ALL_CAN_READ | v8::ALL_CAN_WRITE), static_cast<v 8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMC onfiguration::OnInstance}, 496 {"doNotCheckSecurityLongAttribute", TestInterfaceCheckSecurityV8Internal::do NotCheckSecurityLongAttributeAttributeGetterCallback, TestInterfaceCheckSecurity V8Internal::doNotCheckSecurityLongAttributeAttributeSetterCallback, 0, 0, 0, sta tic_cast<v8::AccessControl>(v8::ALL_CAN_READ | v8::ALL_CAN_WRITE), static_cast<v 8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMC onfiguration::OnInstance},
461 {"doNotCheckSecurityReadonlyLongAttribute", TestInterfaceCheckSecurityV8Inte rnal::doNotCheckSecurityReadonlyLongAttributeAttributeGetterCallback, 0, 0, 0, 0 , static_cast<v8::AccessControl>(v8::ALL_CAN_READ), static_cast<v8::PropertyAttr ibute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::O nInstance}, 497 {"doNotCheckSecurityReadonlyLongAttribute", TestInterfaceCheckSecurityV8Inte rnal::doNotCheckSecurityReadonlyLongAttributeAttributeGetterCallback, 0, 0, 0, 0 , static_cast<v8::AccessControl>(v8::ALL_CAN_READ), static_cast<v8::PropertyAttr ibute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::O nInstance},
462 {"doNotCheckSecurityOnSetterLongAttribute", TestInterfaceCheckSecurityV8Inte rnal::doNotCheckSecurityOnSetterLongAttributeAttributeGetterCallback, TestInterf aceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttributeAttributeSett erCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::ALL_CAN_WRITE), static_c ast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V 8DOMConfiguration::OnInstance}, 498 {"doNotCheckSecurityOnSetterLongAttribute", TestInterfaceCheckSecurityV8Inte rnal::doNotCheckSecurityOnSetterLongAttributeAttributeGetterCallback, TestInterf aceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttributeAttributeSett erCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::ALL_CAN_WRITE), static_c ast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V 8DOMConfiguration::OnInstance},
463 {"doNotCheckSecurityReplaceableReadonlyLongAttribute", TestInterfaceCheckSec urityV8Internal::doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGett erCallback, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityForc eSetAttributeOnThisCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::ALL_CAN _READ | v8::ALL_CAN_WRITE), static_cast<v8::PropertyAttribute>(v8::None), V8DOMC onfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 499 {"doNotCheckSecurityReplaceableReadonlyLongAttribute", TestInterfaceCheckSec urityV8Internal::doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGett erCallback, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityForc eSetAttributeOnThisCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::ALL_CAN _READ | v8::ALL_CAN_WRITE), static_cast<v8::PropertyAttribute>(v8::None), V8DOMC onfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
464 }; 500 };
465 501
502 static const V8DOMConfiguration::AccessorConfiguration V8TestInterfaceCheckSecur ityAccessors[] = {
503 {"doNotCheckSecurityReplaceableReadonlyLongAccessor", TestInterfaceCheckSecu rityV8Internal::doNotCheckSecurityReplaceableReadonlyLongAccessorAttributeGetter Callback, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReplaceableRea donlyLongAccessorAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl >(v8::ALL_CAN_READ | v8::ALL_CAN_WRITE), static_cast<v8::PropertyAttribute>(v8:: None), V8DOMConfiguration::ExposedToAllScripts},
504 };
505
466 static const V8DOMConfiguration::MethodConfiguration V8TestInterfaceCheckSecurit yMethods[] = { 506 static const V8DOMConfiguration::MethodConfiguration V8TestInterfaceCheckSecurit yMethods[] = {
467 {"voidMethod", TestInterfaceCheckSecurityV8Internal::voidMethodMethodCallbac k, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 507 {"voidMethod", TestInterfaceCheckSecurityV8Internal::voidMethodMethodCallbac k, 0, 0, V8DOMConfiguration::ExposedToAllScripts},
468 }; 508 };
469 509
470 static void installV8TestInterfaceCheckSecurityTemplate(v8::Local<v8::FunctionTe mplate> functionTemplate, v8::Isolate* isolate) 510 static void installV8TestInterfaceCheckSecurityTemplate(v8::Local<v8::FunctionTe mplate> functionTemplate, v8::Isolate* isolate)
471 { 511 {
472 functionTemplate->ReadOnlyPrototype(); 512 functionTemplate->ReadOnlyPrototype();
473 513
474 v8::Local<v8::Signature> defaultSignature; 514 v8::Local<v8::Signature> defaultSignature;
475 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, func tionTemplate, "TestInterfaceCheckSecurity", v8::Local<v8::FunctionTemplate>(), V 8TestInterfaceCheckSecurity::internalFieldCount, 515 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, func tionTemplate, "TestInterfaceCheckSecurity", v8::Local<v8::FunctionTemplate>(), V 8TestInterfaceCheckSecurity::internalFieldCount,
476 V8TestInterfaceCheckSecurityAttributes, WTF_ARRAY_LENGTH(V8TestInterface CheckSecurityAttributes), 516 V8TestInterfaceCheckSecurityAttributes, WTF_ARRAY_LENGTH(V8TestInterface CheckSecurityAttributes),
477 0, 0, 517 V8TestInterfaceCheckSecurityAccessors, WTF_ARRAY_LENGTH(V8TestInterfaceC heckSecurityAccessors),
478 V8TestInterfaceCheckSecurityMethods, WTF_ARRAY_LENGTH(V8TestInterfaceChe ckSecurityMethods)); 518 V8TestInterfaceCheckSecurityMethods, WTF_ARRAY_LENGTH(V8TestInterfaceChe ckSecurityMethods));
479 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT emplate(); 519 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT emplate();
480 ALLOW_UNUSED_LOCAL(instanceTemplate); 520 ALLOW_UNUSED_LOCAL(instanceTemplate);
481 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp eTemplate(); 521 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp eTemplate();
482 ALLOW_UNUSED_LOCAL(prototypeTemplate); 522 ALLOW_UNUSED_LOCAL(prototypeTemplate);
483 instanceTemplate->SetAccessCheckCallbacks(TestInterfaceCheckSecurityV8Intern al::namedSecurityCheck, TestInterfaceCheckSecurityV8Internal::indexedSecurityChe ck, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&V8TestInterfaceChec kSecurity::wrapperTypeInfo))); 523 instanceTemplate->SetAccessCheckCallbacks(TestInterfaceCheckSecurityV8Intern al::namedSecurityCheck, TestInterfaceCheckSecurityV8Internal::indexedSecurityChe ck, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&V8TestInterfaceChec kSecurity::wrapperTypeInfo)));
484 static const V8DOMConfiguration::AttributeConfiguration doNotCheckSecurityVo idMethodOriginSafeAttributeConfiguration = { 524 static const V8DOMConfiguration::AttributeConfiguration doNotCheckSecurityVo idMethodOriginSafeAttributeConfiguration = {
485 "doNotCheckSecurityVoidMethod", TestInterfaceCheckSecurityV8Internal::do NotCheckSecurityVoidMethodOriginSafeMethodGetterCallback, TestInterfaceCheckSecu rityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback, 0, 0, &V8TestInterfaceCheckSecurity::wrapperTypeInfo, v8::ALL_CAN_READ, static_cast<v8 ::PropertyAttribute>(v8::DontDelete), V8DOMConfiguration::ExposedToAllScripts, V 8DOMConfiguration::OnInstance, 525 "doNotCheckSecurityVoidMethod", TestInterfaceCheckSecurityV8Internal::do NotCheckSecurityVoidMethodOriginSafeMethodGetterCallback, TestInterfaceCheckSecu rityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback, 0, 0, &V8TestInterfaceCheckSecurity::wrapperTypeInfo, v8::ALL_CAN_READ, static_cast<v8 ::PropertyAttribute>(v8::DontDelete), V8DOMConfiguration::ExposedToAllScripts, V 8DOMConfiguration::OnInstance,
486 }; 526 };
487 V8DOMConfiguration::installAttribute(isolate, prototypeTemplate, v8::Local<v 8::ObjectTemplate>(), doNotCheckSecurityVoidMethodOriginSafeAttributeConfigurati on); 527 V8DOMConfiguration::installAttribute(isolate, prototypeTemplate, v8::Local<v 8::ObjectTemplate>(), doNotCheckSecurityVoidMethodOriginSafeAttributeConfigurati on);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 { 566 {
527 scriptWrappable->toImpl<TestInterfaceCheckSecurity>()->ref(); 567 scriptWrappable->toImpl<TestInterfaceCheckSecurity>()->ref();
528 } 568 }
529 569
530 void V8TestInterfaceCheckSecurity::derefObject(ScriptWrappable* scriptWrappable) 570 void V8TestInterfaceCheckSecurity::derefObject(ScriptWrappable* scriptWrappable)
531 { 571 {
532 scriptWrappable->toImpl<TestInterfaceCheckSecurity>()->deref(); 572 scriptWrappable->toImpl<TestInterfaceCheckSecurity>()->deref();
533 } 573 }
534 574
535 } // namespace blink 575 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698