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

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: missed renames 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 10562 matching lines...) Expand 10 before | Expand all | Expand 10 after
10660 v8::Handle<v8::Object> V8TestObject::findInstanceInPrototypeChain(v8::Handle<v8: :Value> v8Value, v8::Isolate* isolate) 10660 v8::Handle<v8::Object> V8TestObject::findInstanceInPrototypeChain(v8::Handle<v8: :Value> v8Value, v8::Isolate* isolate)
10661 { 10661 {
10662 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe rTypeInfo, v8Value); 10662 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe rTypeInfo, v8Value);
10663 } 10663 }
10664 10664
10665 TestObject* V8TestObject::toNativeWithTypeCheck(v8::Isolate* isolate, v8::Handle <v8::Value> value) 10665 TestObject* V8TestObject::toNativeWithTypeCheck(v8::Isolate* isolate, v8::Handle <v8::Value> value)
10666 { 10666 {
10667 return hasInstance(value, isolate) ? fromInternalPointer(blink::toInternalPo inter(v8::Handle<v8::Object>::Cast(value))) : 0; 10667 return hasInstance(value, isolate) ? fromInternalPointer(blink::toInternalPo inter(v8::Handle<v8::Object>::Cast(value))) : 0;
10668 } 10668 }
10669 10669
10670 void V8TestObject::installPerContextEnabledProperties(v8::Handle<v8::Object> ins tanceObject, TestObject* impl, v8::Isolate* isolate) 10670 void V8TestObject::installConditionallyEnabledProperties(v8::Handle<v8::Object> instanceObject, v8::Isolate* isolate)
10671 { 10671 {
10672 v8::Local<v8::Object> prototypeObject = v8::Local<v8::Object>::Cast(instance Object->GetPrototype()); 10672 v8::Local<v8::Object> prototypeObject = v8::Local<v8::Object>::Cast(instance Object->GetPrototype());
10673 if (ContextFeatures::featureNameEnabled(impl->document())) { 10673 ExecutionContext* context = toExecutionContext(prototypeObject->CreationCont ext());
10674
10675 if (context && context->isDocument() && ContextFeatures::featureNameEnabled( toDocument(context))) {
10674 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu ration =\ 10676 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu ration =\
10675 {"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}; 10677 {"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};
10676 V8DOMConfiguration::installAttribute(instanceObject, prototypeObject, at tributeConfiguration, isolate); 10678 V8DOMConfiguration::installAttribute(instanceObject, prototypeObject, at tributeConfiguration, isolate);
10677 } 10679 }
10678 if (ContextFeatures::featureNameEnabled(impl->document())) { 10680 if (context && context->isDocument() && ContextFeatures::featureNameEnabled( toDocument(context))) {
10679 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu ration =\ 10681 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu ration =\
10680 {"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}; 10682 {"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};
10681 V8DOMConfiguration::installAttribute(instanceObject, prototypeObject, at tributeConfiguration, isolate); 10683 V8DOMConfiguration::installAttribute(instanceObject, prototypeObject, at tributeConfiguration, isolate);
10682 } 10684 }
10683 } 10685 }
10684 10686
10685 void V8TestObject::installPerContextEnabledMethods(v8::Handle<v8::Object> protot ypeObject, v8::Isolate* isolate) 10687 void V8TestObject::installConditionallyEnabledMethods(v8::Handle<v8::Object> pro totypeObject, v8::Isolate* isolate)
10686 { 10688 {
10687 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domT emplate(isolate)); 10689 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domT emplate(isolate));
10688
10689 ExecutionContext* context = toExecutionContext(prototypeObject->CreationCont ext()); 10690 ExecutionContext* context = toExecutionContext(prototypeObject->CreationCont ext());
10690 ASSERT(context); 10691 ASSERT(context);
10691 if (context->isDocument() && ContextFeatures::featureNameEnabled(toDocument( context))) { 10692
10692 static const V8DOMConfiguration::MethodConfiguration methodConfiguration = {"perContextEnabledVoidMethod", TestObjectV8Internal::perContextEnabledVoidMe thodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}; 10693 if (context && context->isDocument() && ContextFeatures::featureNameEnabled( toDocument(context))) {
10693 V8DOMConfiguration::installMethod(prototypeObject, defaultSignature, v8: :None, methodConfiguration, isolate); 10694 prototypeObject->Set(v8AtomicString(isolate, "perContextEnabledVoidMetho d"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::perContextEnabledV oidMethodMethodCallback, v8Undefined(), defaultSignature, 0)->GetFunction());
10694 } 10695 }
10695 } 10696 }
10696 10697
10697 v8::Handle<v8::Object> wrap(TestObject* impl, v8::Handle<v8::Object> creationCon text, v8::Isolate* isolate) 10698 v8::Handle<v8::Object> wrap(TestObject* impl, v8::Handle<v8::Object> creationCon text, v8::Isolate* isolate)
10698 { 10699 {
10699 ASSERT(impl); 10700 ASSERT(impl);
10700 ASSERT(!DOMDataStore::containsWrapper<V8TestObject>(impl, isolate)); 10701 ASSERT(!DOMDataStore::containsWrapper<V8TestObject>(impl, isolate));
10701 return V8TestObject::createWrapper(impl, creationContext, isolate); 10702 return V8TestObject::createWrapper(impl, creationContext, isolate);
10702 } 10703 }
10703 10704
10704 v8::Handle<v8::Object> V8TestObject::createWrapper(PassRefPtr<TestObject> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 10705 v8::Handle<v8::Object> V8TestObject::createWrapper(PassRefPtr<TestObject> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
10705 { 10706 {
10706 ASSERT(impl); 10707 ASSERT(impl);
10707 ASSERT(!DOMDataStore::containsWrapper<V8TestObject>(impl.get(), isolate)); 10708 ASSERT(!DOMDataStore::containsWrapper<V8TestObject>(impl.get(), isolate));
10708 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { 10709 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
10709 const WrapperTypeInfo* actualInfo = ScriptWrappable::fromObject(impl.get ())->typeInfo(); 10710 const WrapperTypeInfo* actualInfo = ScriptWrappable::fromObject(impl.get ())->typeInfo();
10710 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper TypeInfo. These will both have 10711 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper TypeInfo. These will both have
10711 // the same object de-ref functions, though, so use that as the basis of the check. 10712 // the same object de-ref functions, though, so use that as the basis of the check.
10712 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction); 10713 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
10713 } 10714 }
10714 10715
10715 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext , &wrapperTypeInfo, toInternalPointer(impl.get()), isolate); 10716 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext , &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
10716 if (UNLIKELY(wrapper.IsEmpty())) 10717 if (UNLIKELY(wrapper.IsEmpty()))
10717 return wrapper; 10718 return wrapper;
10718 10719
10719 installPerContextEnabledProperties(wrapper, impl.get(), isolate); 10720 installConditionallyEnabledProperties(wrapper, isolate);
10720 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl, &wrapperTypeInf o, wrapper, isolate, WrapperConfiguration::Independent); 10721 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl, &wrapperTypeInf o, wrapper, isolate, WrapperConfiguration::Independent);
10721 return wrapper; 10722 return wrapper;
10722 } 10723 }
10723 10724
10724 void V8TestObject::derefObject(ScriptWrappableBase* internalPointer) 10725 void V8TestObject::derefObject(ScriptWrappableBase* internalPointer)
10725 { 10726 {
10726 fromInternalPointer(internalPointer)->deref(); 10727 fromInternalPointer(internalPointer)->deref();
10727 } 10728 }
10728 10729
10729 template<> 10730 template<>
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
11253 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) { 11254 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) {
11254 // FIXME: We should support exceptions other than DOM exceptions. 11255 // FIXME: We should support exceptions other than DOM exceptions.
11255 RELEASE_ASSERT_NOT_REACHED(); 11256 RELEASE_ASSERT_NOT_REACHED();
11256 } 11257 }
11257 return false; 11258 return false;
11258 } 11259 }
11259 return true; 11260 return true;
11260 } 11261 }
11261 11262
11262 } // namespace blink 11263 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestObject.h ('k') | Source/bindings/tests/results/V8TestSpecialOperations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698