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

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

Issue 424163002: Enable the WebIDL [Exposed] annotation on an interface's members. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 "V8TestObject.h" 8 #include "V8TestObject.h"
9 9
10 #include "bindings/core/v8/BindingSecurity.h" 10 #include "bindings/core/v8/BindingSecurity.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 } 77 }
78 78
79 } // namespace blink 79 } // namespace blink
80 80
81 void webCoreInitializeScriptWrappableForInterface(blink::TestObject* object) 81 void webCoreInitializeScriptWrappableForInterface(blink::TestObject* object)
82 { 82 {
83 blink::initializeScriptWrappableForInterface(object); 83 blink::initializeScriptWrappableForInterface(object);
84 } 84 }
85 85
86 namespace blink { 86 namespace blink {
87 const WrapperTypeInfo V8TestObject::wrapperTypeInfo = { gin::kEmbedderBlink, V8T estObject::domTemplate, V8TestObject::derefObject, 0, 0, 0, V8TestObject::instal lPerContextEnabledMethods, 0, WrapperTypeObjectPrototype, RefCountedObject }; 87 const WrapperTypeInfo V8TestObject::wrapperTypeInfo = { gin::kEmbedderBlink, V8T estObject::domTemplate, V8TestObject::derefObject, 0, 0, 0, V8TestObject::instal lConditionallyEnabledMethods, 0, WrapperTypeObjectPrototype, RefCountedObject };
88 88
89 namespace TestObjectV8Internal { 89 namespace TestObjectV8Internal {
90 90
91 template <typename T> void V8_USE(T) { } 91 template <typename T> void V8_USE(T) { }
92 92
93 static void stringifierAttributeAttributeGetter(const v8::PropertyCallbackInfo<v 8::Value>& info) 93 static void stringifierAttributeAttributeGetter(const v8::PropertyCallbackInfo<v 8::Value>& info)
94 { 94 {
95 v8::Handle<v8::Object> holder = info.Holder(); 95 v8::Handle<v8::Object> holder = info.Holder();
96 TestObject* impl = V8TestObject::toNative(holder); 96 TestObject* impl = V8TestObject::toNative(holder);
97 v8SetReturnValueString(info, impl->stringifierAttribute(), info.GetIsolate() ); 97 v8SetReturnValueString(info, impl->stringifierAttribute(), info.GetIsolate() );
(...skipping 10512 matching lines...) Expand 10 before | Expand all | Expand 10 after
10610 v8::Handle<v8::Object> V8TestObject::findInstanceInPrototypeChain(v8::Handle<v8: :Value> v8Value, v8::Isolate* isolate) 10610 v8::Handle<v8::Object> V8TestObject::findInstanceInPrototypeChain(v8::Handle<v8: :Value> v8Value, v8::Isolate* isolate)
10611 { 10611 {
10612 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe rTypeInfo, v8Value); 10612 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe rTypeInfo, v8Value);
10613 } 10613 }
10614 10614
10615 TestObject* V8TestObject::toNativeWithTypeCheck(v8::Isolate* isolate, v8::Handle <v8::Value> value) 10615 TestObject* V8TestObject::toNativeWithTypeCheck(v8::Isolate* isolate, v8::Handle <v8::Value> value)
10616 { 10616 {
10617 return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Obje ct>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) : 0; 10617 return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Obje ct>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) : 0;
10618 } 10618 }
10619 10619
10620 void V8TestObject::installPerContextEnabledProperties(v8::Handle<v8::Object> ins tanceTemplate, TestObject* impl, v8::Isolate* isolate) 10620 void V8TestObject::installConditionallyEnabledProperties(v8::Handle<v8::Object> instanceTemplate, v8::Isolate* isolate)
10621 { 10621 {
10622 v8::Local<v8::Object> prototypeTemplate = v8::Local<v8::Object>::Cast(instan ceTemplate->GetPrototype()); 10622 v8::Local<v8::Object> prototypeTemplate = v8::Local<v8::Object>::Cast(instan ceTemplate->GetPrototype());
10623 if (ContextFeatures::featureNameEnabled(impl->document())) { 10623 ExecutionContext* context = toExecutionContext(prototypeTemplate->CreationCo ntext());
10624
10625 if (context && context->isDocument() && ContextFeatures::featureNameEnabled( toDocument(context))) {
10624 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu ration =\ 10626 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu ration =\
10625 {"perContextEnabledLongAttribute", TestObjectV8Internal::perContextEnabl edLongAttributeAttributeGetterCallback, TestObjectV8Internal::perContextEnabledL ongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8: :DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::Exp osedToAllScripts, V8DOMConfiguration::OnInstance}; 10627 {"perContextEnabledLongAttribute", TestObjectV8Internal::perContextEnabl edLongAttributeAttributeGetterCallback, TestObjectV8Internal::perContextEnabledL ongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8: :DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::Exp osedToAllScripts, V8DOMConfiguration::OnInstance};
10626 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate , attributeConfiguration, isolate); 10628 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate , attributeConfiguration, isolate);
10627 } 10629 }
10628 if (ContextFeatures::featureNameEnabled(impl->document())) { 10630 if (context && context->isDocument() && ContextFeatures::featureNameEnabled( toDocument(context))) {
10629 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu ration =\ 10631 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu ration =\
10630 {"perContextEnabledRuntimeEnabledLongAttribute", TestObjectV8Internal::p erContextEnabledRuntimeEnabledLongAttributeAttributeGetterCallback, TestObjectV8 Internal::perContextEnabledRuntimeEnabledLongAttributeAttributeSetterCallback, 0 , 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAtt ribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration:: OnInstance}; 10632 {"perContextEnabledRuntimeEnabledLongAttribute", TestObjectV8Internal::p erContextEnabledRuntimeEnabledLongAttributeAttributeGetterCallback, TestObjectV8 Internal::perContextEnabledRuntimeEnabledLongAttributeAttributeSetterCallback, 0 , 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAtt ribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration:: OnInstance};
10631 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate , attributeConfiguration, isolate); 10633 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate , attributeConfiguration, isolate);
10632 } 10634 }
10633 } 10635 }
10634 10636
10635 void V8TestObject::installPerContextEnabledMethods(v8::Handle<v8::Object> protot ypeTemplate, v8::Isolate* isolate) 10637 void V8TestObject::installConditionallyEnabledMethods(v8::Handle<v8::Object> pro totypeTemplate, v8::Isolate* isolate)
10636 { 10638 {
10637 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domT emplate(isolate)); 10639 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domT emplate(isolate));
10640 ExecutionContext* context = toExecutionContext(prototypeTemplate->CreationCo ntext());
10638 10641
10639 ExecutionContext* context = toExecutionContext(prototypeTemplate->CreationCo ntext()); 10642 if (context && context->isDocument() && ContextFeatures::featureNameEnabled( toDocument(context))) {
10640 if (context && context->isDocument() && ContextFeatures::featureNameEnabled( toDocument(context)))
10641 prototypeTemplate->Set(v8AtomicString(isolate, "perContextEnabledVoidMet hod"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::perContextEnable dVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0)->GetFunction()); 10643 prototypeTemplate->Set(v8AtomicString(isolate, "perContextEnabledVoidMet hod"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::perContextEnable dVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0)->GetFunction());
10644 }
10642 } 10645 }
10643 10646
10644 v8::Handle<v8::Object> wrap(TestObject* impl, v8::Handle<v8::Object> creationCon text, v8::Isolate* isolate) 10647 v8::Handle<v8::Object> wrap(TestObject* impl, v8::Handle<v8::Object> creationCon text, v8::Isolate* isolate)
10645 { 10648 {
10646 ASSERT(impl); 10649 ASSERT(impl);
10647 ASSERT(!DOMDataStore::containsWrapper<V8TestObject>(impl, isolate)); 10650 ASSERT(!DOMDataStore::containsWrapper<V8TestObject>(impl, isolate));
10648 return V8TestObject::createWrapper(impl, creationContext, isolate); 10651 return V8TestObject::createWrapper(impl, creationContext, isolate);
10649 } 10652 }
10650 10653
10651 v8::Handle<v8::Object> V8TestObject::createWrapper(PassRefPtr<TestObject> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 10654 v8::Handle<v8::Object> V8TestObject::createWrapper(PassRefPtr<TestObject> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
10652 { 10655 {
10653 ASSERT(impl); 10656 ASSERT(impl);
10654 ASSERT(!DOMDataStore::containsWrapper<V8TestObject>(impl.get(), isolate)); 10657 ASSERT(!DOMDataStore::containsWrapper<V8TestObject>(impl.get(), isolate));
10655 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { 10658 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
10656 const WrapperTypeInfo* actualInfo = ScriptWrappable::fromObject(impl.get ())->typeInfo(); 10659 const WrapperTypeInfo* actualInfo = ScriptWrappable::fromObject(impl.get ())->typeInfo();
10657 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper TypeInfo. These will both have 10660 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper TypeInfo. These will both have
10658 // the same object de-ref functions, though, so use that as the basis of the check. 10661 // the same object de-ref functions, though, so use that as the basis of the check.
10659 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction); 10662 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
10660 } 10663 }
10661 10664
10662 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext , &wrapperTypeInfo, toInternalPointer(impl.get()), isolate); 10665 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext , &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
10663 if (UNLIKELY(wrapper.IsEmpty())) 10666 if (UNLIKELY(wrapper.IsEmpty()))
10664 return wrapper; 10667 return wrapper;
10665 10668
10666 installPerContextEnabledProperties(wrapper, impl.get(), isolate); 10669 installConditionallyEnabledProperties(wrapper, isolate);
10667 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl, &wrapperTypeInf o, wrapper, isolate, WrapperConfiguration::Independent); 10670 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl, &wrapperTypeInf o, wrapper, isolate, WrapperConfiguration::Independent);
10668 return wrapper; 10671 return wrapper;
10669 } 10672 }
10670 10673
10671 void V8TestObject::derefObject(void* object) 10674 void V8TestObject::derefObject(void* object)
10672 { 10675 {
10673 fromInternalPointer(object)->deref(); 10676 fromInternalPointer(object)->deref();
10674 } 10677 }
10675 10678
10676 template<> 10679 template<>
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
11200 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) { 11203 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) {
11201 // FIXME: We should support exceptions other than DOM exceptions. 11204 // FIXME: We should support exceptions other than DOM exceptions.
11202 RELEASE_ASSERT_NOT_REACHED(); 11205 RELEASE_ASSERT_NOT_REACHED();
11203 } 11206 }
11204 return false; 11207 return false;
11205 } 11208 }
11206 return true; 11209 return true;
11207 } 11210 }
11208 11211
11209 } // namespace blink 11212 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698