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

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

Issue 456683002: bindings: Introduces type-check for the internal pointers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Synced. Created 6 years, 4 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 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu e); 524 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu e);
525 } 525 }
526 526
527 v8::Handle<v8::Object> V8TestInterfaceCheckSecurity::findInstanceInPrototypeChai n(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate) 527 v8::Handle<v8::Object> V8TestInterfaceCheckSecurity::findInstanceInPrototypeChai n(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate)
528 { 528 {
529 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe rTypeInfo, v8Value); 529 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe rTypeInfo, v8Value);
530 } 530 }
531 531
532 TestInterfaceCheckSecurity* V8TestInterfaceCheckSecurity::toNativeWithTypeCheck( v8::Isolate* isolate, v8::Handle<v8::Value> value) 532 TestInterfaceCheckSecurity* V8TestInterfaceCheckSecurity::toNativeWithTypeCheck( v8::Isolate* isolate, v8::Handle<v8::Value> value)
533 { 533 {
534 return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Obje ct>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) : 0; 534 return hasInstance(value, isolate) ? fromInternalPointer(blink::toInternalPo inter(v8::Handle<v8::Object>::Cast(value))) : 0;
535 } 535 }
536 536
537 v8::Handle<v8::Object> wrap(TestInterfaceCheckSecurity* impl, v8::Handle<v8::Obj ect> creationContext, v8::Isolate* isolate) 537 v8::Handle<v8::Object> wrap(TestInterfaceCheckSecurity* impl, v8::Handle<v8::Obj ect> creationContext, v8::Isolate* isolate)
538 { 538 {
539 ASSERT(impl); 539 ASSERT(impl);
540 ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceCheckSecurity>(impl, is olate)); 540 ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceCheckSecurity>(impl, is olate));
541 return V8TestInterfaceCheckSecurity::createWrapper(impl, creationContext, is olate); 541 return V8TestInterfaceCheckSecurity::createWrapper(impl, creationContext, is olate);
542 } 542 }
543 543
544 v8::Handle<v8::Object> V8TestInterfaceCheckSecurity::createWrapper(PassRefPtr<Te stInterfaceCheckSecurity> impl, v8::Handle<v8::Object> creationContext, v8::Isol ate* isolate) 544 v8::Handle<v8::Object> V8TestInterfaceCheckSecurity::createWrapper(PassRefPtr<Te stInterfaceCheckSecurity> impl, v8::Handle<v8::Object> creationContext, v8::Isol ate* isolate)
545 { 545 {
546 ASSERT(impl); 546 ASSERT(impl);
547 ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceCheckSecurity>(impl.get (), isolate)); 547 ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceCheckSecurity>(impl.get (), isolate));
548 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { 548 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
549 const WrapperTypeInfo* actualInfo = ScriptWrappable::fromObject(impl.get ())->typeInfo(); 549 const WrapperTypeInfo* actualInfo = ScriptWrappable::fromObject(impl.get ())->typeInfo();
550 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper TypeInfo. These will both have 550 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper TypeInfo. These will both have
551 // the same object de-ref functions, though, so use that as the basis of the check. 551 // the same object de-ref functions, though, so use that as the basis of the check.
552 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction); 552 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
553 } 553 }
554 554
555 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext , &wrapperTypeInfo, toInternalPointer(impl.get()), isolate); 555 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext , &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
556 if (UNLIKELY(wrapper.IsEmpty())) 556 if (UNLIKELY(wrapper.IsEmpty()))
557 return wrapper; 557 return wrapper;
558 558
559 installPerContextEnabledProperties(wrapper, impl.get(), isolate); 559 installPerContextEnabledProperties(wrapper, impl.get(), isolate);
560 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceCheckSecurity>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent); 560 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceCheckSecurity>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
561 return wrapper; 561 return wrapper;
562 } 562 }
563 563
564 void V8TestInterfaceCheckSecurity::derefObject(void* object) 564 void V8TestInterfaceCheckSecurity::derefObject(ScriptWrappableBase* internalPoin ter)
565 { 565 {
566 fromInternalPointer(object)->deref(); 566 fromInternalPointer(internalPointer)->deref();
567 } 567 }
568 568
569 template<> 569 template<>
570 v8::Handle<v8::Value> toV8NoInline(TestInterfaceCheckSecurity* impl, v8::Handle< v8::Object> creationContext, v8::Isolate* isolate) 570 v8::Handle<v8::Value> toV8NoInline(TestInterfaceCheckSecurity* impl, v8::Handle< v8::Object> creationContext, v8::Isolate* isolate)
571 { 571 {
572 return toV8(impl, creationContext, isolate); 572 return toV8(impl, creationContext, isolate);
573 } 573 }
574 574
575 } // namespace blink 575 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698