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

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

Issue 140663012: IDL compiler: Window-specific code + Window-only features (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: No headers for named constructor attributes Created 6 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 /* 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 imp->setDoNotCheckSecurityOnSetterLongAttribute(cppValue); 147 imp->setDoNotCheckSecurityOnSetterLongAttribute(cppValue);
148 } 148 }
149 149
150 static void doNotCheckSecurityOnSetterLongAttributeAttributeSetterCallback(v8::L ocal<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v oid>& info) 150 static void doNotCheckSecurityOnSetterLongAttributeAttributeSetterCallback(v8::L ocal<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v oid>& info)
151 { 151 {
152 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 152 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
153 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttribut eAttributeSetter(jsValue, info); 153 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttribut eAttributeSetter(jsValue, info);
154 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 154 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
155 } 155 }
156 156
157 static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetter(co nst v8::PropertyCallbackInfo<v8::Value>& info)
158 {
159 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(inf o.Holder());
160 v8SetReturnValueInt(info, imp->doNotCheckSecurityReplaceableReadonlyLongAttr ibute());
161 }
162
163 static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetterCal lback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
164 {
165 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
166 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReplaceableReadonlyL ongAttributeAttributeGetter(info);
167 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
168 }
169
170 static void TestInterfaceCheckSecurityReplaceableAttributeSetter(v8::Local<v8::S tring> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
171 {
172 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(inf o.Holder());
173 v8::String::Utf8Value attributeName(name);
174 ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName, "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate());
175 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame (), exceptionState)) {
176 exceptionState.throwIfNeeded();
177 return;
178 }
179 info.This()->ForceSet(name, jsValue);
180 }
181
182 static void TestInterfaceCheckSecurityReplaceableAttributeSetterCallback(v8::Loc al<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInf o<void>& info)
183 {
184 TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityReplaceableA ttributeSetter(name, jsValue, info);
185 }
186
157 bool indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::Access Type type, v8::Local<v8::Value>) 187 bool indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::Access Type type, v8::Local<v8::Value>)
158 { 188 {
159 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(ho st); 189 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(ho st);
160 return BindingSecurity::shouldAllowAccessToFrame(v8::Isolate::GetCurrent(), imp->frame(), DoNotReportSecurityError); 190 return BindingSecurity::shouldAllowAccessToFrame(v8::Isolate::GetCurrent(), imp->frame(), DoNotReportSecurityError);
161 } 191 }
162 192
163 bool namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8 ::AccessType type, v8::Local<v8::Value>) 193 bool namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8 ::AccessType type, v8::Local<v8::Value>)
164 { 194 {
165 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(ho st); 195 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(ho st);
166 return BindingSecurity::shouldAllowAccessToFrame(v8::Isolate::GetCurrent(), imp->frame(), DoNotReportSecurityError); 196 return BindingSecurity::shouldAllowAccessToFrame(v8::Isolate::GetCurrent(), imp->frame(), DoNotReportSecurityError);
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 v8SetReturnValue(info, privateTemplate->GetFunction()); 467 v8SetReturnValue(info, privateTemplate->GetFunction());
438 } 468 }
439 469
440 static void doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetterCallbac k(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 470 static void doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetterCallbac k(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
441 { 471 {
442 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 472 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
443 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMetho dOriginSafeMethodGetter(info); 473 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMetho dOriginSafeMethodGetter(info);
444 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 474 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
445 } 475 }
446 476
477 static void doNotCheckSecurityDoNotCheckSignatureVoidMethodMethod(const v8::Func tionCallbackInfo<v8::Value>& info)
478 {
479 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(inf o.Holder());
480 imp->doNotCheckSecurityDoNotCheckSignatureVoidMethod();
481 }
482
483 static void doNotCheckSecurityDoNotCheckSignatureVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
484 {
485 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
486 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityDoNotCheckSignatureV oidMethodMethod(info);
487 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
488 }
489
490 static void doNotCheckSecurityDoNotCheckSignatureVoidMethodOriginSafeMethodGette r(const v8::PropertyCallbackInfo<v8::Value>& info)
491 {
492 // This is only for getting a unique pointer which we can pass to privateTem plate.
493 static int privateTemplateUniqueKey;
494 WrapperWorldType currentWorldType = worldType(info.GetIsolate());
495 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
496 v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(cur rentWorldType, &privateTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal:: doNotCheckSecurityDoNotCheckSignatureVoidMethodMethodCallback, v8Undefined(), v8 ::Local<v8::Signature>(), 0);
497
498 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8 TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), currentWorldType));
499 if (holder.IsEmpty()) {
500 // This is only reachable via |object.__proto__.func|, in which case it
501 // has already passed the same origin security check
502 v8SetReturnValue(info, privateTemplate->GetFunction());
503 return;
504 }
505 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol der);
506 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame (), DoNotReportSecurityError)) {
507 static int sharedTemplateUniqueKey;
508 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate( currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal ::doNotCheckSecurityDoNotCheckSignatureVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0);
509 v8SetReturnValue(info, sharedTemplate->GetFunction());
510 return;
511 }
512
513 v8::Local<v8::Value> hiddenValue = getHiddenValue(info.GetIsolate(), info.Th is(), "doNotCheckSecurityDoNotCheckSignatureVoidMethod");
514 if (!hiddenValue.IsEmpty()) {
515 v8SetReturnValue(info, hiddenValue);
516 return;
517 }
518
519 v8SetReturnValue(info, privateTemplate->GetFunction());
520 }
521
522 static void doNotCheckSecurityDoNotCheckSignatureVoidMethodOriginSafeMethodGette rCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info )
523 {
524 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
525 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityDoNotCheckSignatureV oidMethodOriginSafeMethodGetter(info);
526 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
527 }
528
447 static void TestInterfaceCheckSecurityOriginSafeMethodSetter(v8::Local<v8::Strin g> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& inf o) 529 static void TestInterfaceCheckSecurityOriginSafeMethodSetter(v8::Local<v8::Strin g> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& inf o)
448 { 530 {
449 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8 TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), worldType(info.GetIso late()))); 531 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8 TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), worldType(info.GetIso late())));
450 if (holder.IsEmpty()) 532 if (holder.IsEmpty())
451 return; 533 return;
452 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol der); 534 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol der);
453 v8::String::Utf8Value attributeName(name); 535 v8::String::Utf8Value attributeName(name);
454 ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName, "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate()); 536 ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName, "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate());
455 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame (), exceptionState)) { 537 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame (), exceptionState)) {
456 exceptionState.throwIfNeeded(); 538 exceptionState.throwIfNeeded();
(...skipping 10 matching lines...) Expand all
467 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 549 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
468 } 550 }
469 551
470 } // namespace TestInterfaceCheckSecurityV8Internal 552 } // namespace TestInterfaceCheckSecurityV8Internal
471 553
472 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceCheckSecu rityAttributes[] = { 554 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceCheckSecu rityAttributes[] = {
473 {"longAttribute", TestInterfaceCheckSecurityV8Internal::longAttributeAttribu teGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), stati c_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 555 {"longAttribute", TestInterfaceCheckSecurityV8Internal::longAttributeAttribu teGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), stati c_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
474 {"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), 0 /* on instance */}, 556 {"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), 0 /* on instance */},
475 {"doNotCheckSecurityReadonlyLongAttribute", TestInterfaceCheckSecurityV8Inte rnal::doNotCheckSecurityReadonlyLongAttributeAttributeGetterCallback, 0, 0, 0, 0 , static_cast<v8::AccessControl>(v8::ALL_CAN_READ), static_cast<v8::PropertyAttr ibute>(v8::None), 0 /* on instance */}, 557 {"doNotCheckSecurityReadonlyLongAttribute", TestInterfaceCheckSecurityV8Inte rnal::doNotCheckSecurityReadonlyLongAttributeAttributeGetterCallback, 0, 0, 0, 0 , static_cast<v8::AccessControl>(v8::ALL_CAN_READ), static_cast<v8::PropertyAttr ibute>(v8::None), 0 /* on instance */},
476 {"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), 0 /* on instance */}, 558 {"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), 0 /* on instance */},
559 {"doNotCheckSecurityReplaceableReadonlyLongAttribute", TestInterfaceCheckSec urityV8Internal::doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGett erCallback, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityRepl aceableAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::ALL_ CAN_READ | v8::ALL_CAN_WRITE), static_cast<v8::PropertyAttribute>(v8::None), 0 / * on instance */},
477 }; 560 };
478 561
479 static const V8DOMConfiguration::MethodConfiguration V8TestInterfaceCheckSecurit yMethods[] = { 562 static const V8DOMConfiguration::MethodConfiguration V8TestInterfaceCheckSecurit yMethods[] = {
480 {"voidMethod", TestInterfaceCheckSecurityV8Internal::voidMethodMethodCallbac k, 0, 0}, 563 {"voidMethod", TestInterfaceCheckSecurityV8Internal::voidMethodMethodCallbac k, 0, 0},
481 }; 564 };
482 565
483 static void configureV8TestInterfaceCheckSecurityTemplate(v8::Handle<v8::Functio nTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorld Type) 566 static void configureV8TestInterfaceCheckSecurityTemplate(v8::Handle<v8::Functio nTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorld Type)
484 { 567 {
485 functionTemplate->ReadOnlyPrototype(); 568 functionTemplate->ReadOnlyPrototype();
486 569
487 v8::Local<v8::Signature> defaultSignature; 570 v8::Local<v8::Signature> defaultSignature;
488 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl ate, "TestInterfaceCheckSecurity", v8::Local<v8::FunctionTemplate>(), V8TestInte rfaceCheckSecurity::internalFieldCount, 571 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl ate, "TestInterfaceCheckSecurity", v8::Local<v8::FunctionTemplate>(), V8TestInte rfaceCheckSecurity::internalFieldCount,
489 V8TestInterfaceCheckSecurityAttributes, WTF_ARRAY_LENGTH(V8TestInterface CheckSecurityAttributes), 572 V8TestInterfaceCheckSecurityAttributes, WTF_ARRAY_LENGTH(V8TestInterface CheckSecurityAttributes),
490 0, 0, 573 0, 0,
491 V8TestInterfaceCheckSecurityMethods, WTF_ARRAY_LENGTH(V8TestInterfaceChe ckSecurityMethods), 574 V8TestInterfaceCheckSecurityMethods, WTF_ARRAY_LENGTH(V8TestInterfaceChe ckSecurityMethods),
492 isolate, currentWorldType); 575 isolate, currentWorldType);
493 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla te->InstanceTemplate(); 576 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla te->InstanceTemplate();
494 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl ate->PrototypeTemplate(); 577 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl ate->PrototypeTemplate();
495 instanceTemplate->SetAccessCheckCallbacks(TestInterfaceCheckSecurityV8Intern al::namedSecurityCheck, TestInterfaceCheckSecurityV8Internal::indexedSecurityChe ck, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&V8TestInterfaceChec kSecurity::wrapperTypeInfo))); 578 instanceTemplate->SetAccessCheckCallbacks(TestInterfaceCheckSecurityV8Intern al::namedSecurityCheck, TestInterfaceCheckSecurityV8Internal::indexedSecurityChe ck, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&V8TestInterfaceChec kSecurity::wrapperTypeInfo)));
496 prototypeTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecurityVo idMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodOr iginSafeMethodGetterCallback, TestInterfaceCheckSecurityV8Internal::TestInterfac eCheckSecurityOriginSafeMethodSetterCallback, v8Undefined(), v8::ALL_CAN_READ, s tatic_cast<v8::PropertyAttribute>(v8::DontDelete)); 579 prototypeTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecurityVo idMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodOr iginSafeMethodGetterCallback, TestInterfaceCheckSecurityV8Internal::TestInterfac eCheckSecurityOriginSafeMethodSetterCallback, v8Undefined(), v8::ALL_CAN_READ, s tatic_cast<v8::PropertyAttribute>(v8::DontDelete));
497 if (currentWorldType == MainWorld) { 580 if (currentWorldType == MainWorld) {
498 prototypeTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecuri tyPerWorldBindingsVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheck SecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallbackForMainWorld, Te stInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSe tterCallback, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute >(v8::DontDelete)); 581 prototypeTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecuri tyPerWorldBindingsVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheck SecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallbackForMainWorld, Te stInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSe tterCallback, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute >(v8::DontDelete));
499 } else { 582 } else {
500 prototypeTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecuri tyPerWorldBindingsVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheck SecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallback, TestInterfaceC heckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback , v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDe lete)); 583 prototypeTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecuri tyPerWorldBindingsVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheck SecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallback, TestInterfaceC heckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback , v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDe lete));
501 } 584 }
502 prototypeTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecurityRe adOnlyVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityRead OnlyVoidMethodOriginSafeMethodGetterCallback, 0, v8Undefined(), v8::ALL_CAN_READ , static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly)); 585 prototypeTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecurityRe adOnlyVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityRead OnlyVoidMethodOriginSafeMethodGetterCallback, 0, v8Undefined(), v8::ALL_CAN_READ , static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
503 instanceTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecurityUnf orgeableVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUn forgeableVoidMethodOriginSafeMethodGetterCallback, TestInterfaceCheckSecurityV8I nternal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback, v8Undefined() , v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete)); 586 instanceTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecurityUnf orgeableVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUn forgeableVoidMethodOriginSafeMethodGetterCallback, TestInterfaceCheckSecurityV8I nternal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback, v8Undefined() , v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
587 prototypeTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecurityDo NotCheckSignatureVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheckS ecurityDoNotCheckSignatureVoidMethodOriginSafeMethodGetterCallback, TestInterfac eCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallba ck, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::Dont Delete));
504 588
505 // Custom toString template 589 // Custom toString template
506 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData: :current()->toStringTemplate()); 590 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData: :current()->toStringTemplate());
507 } 591 }
508 592
509 v8::Handle<v8::FunctionTemplate> V8TestInterfaceCheckSecurity::domTemplate(v8::I solate* isolate, WrapperWorldType currentWorldType) 593 v8::Handle<v8::FunctionTemplate> V8TestInterfaceCheckSecurity::domTemplate(v8::I solate* isolate, WrapperWorldType currentWorldType)
510 { 594 {
511 V8PerIsolateData* data = V8PerIsolateData::from(isolate); 595 V8PerIsolateData* data = V8PerIsolateData::from(isolate);
512 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo rldType).find(&wrapperTypeInfo); 596 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo rldType).find(&wrapperTypeInfo);
513 if (result != data->templateMap(currentWorldType).end()) 597 if (result != data->templateMap(currentWorldType).end())
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 fromInternalPointer(object)->deref(); 636 fromInternalPointer(object)->deref();
553 } 637 }
554 638
555 template<> 639 template<>
556 v8::Handle<v8::Value> toV8NoInline(TestInterfaceCheckSecurity* impl, v8::Handle< v8::Object> creationContext, v8::Isolate* isolate) 640 v8::Handle<v8::Value> toV8NoInline(TestInterfaceCheckSecurity* impl, v8::Handle< v8::Object> creationContext, v8::Isolate* isolate)
557 { 641 {
558 return toV8(impl, creationContext, isolate); 642 return toV8(impl, creationContext, isolate);
559 } 643 }
560 644
561 } // namespace WebCore 645 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698