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

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

Issue 22649003: Have the Performance interface inherit EventTarget (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 /* 1 /*
2 This file is part of the Blink open source project. 2 This file is part of the Blink open source project.
3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY! 3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY!
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19 */ 19 */
20 20
21 #include "config.h" 21 #include "config.h"
22 #include "V8TestObject.h" 22 #include "V8TestObject.h"
23 23
24 #include "HTMLNames.h" 24 #include "HTMLNames.h"
25 #include "RuntimeEnabledFeatures.h" 25 #include "RuntimeEnabledFeatures.h"
26 #include "V8DOMStringList.h" 26 #include "V8DOMStringList.h"
27 #include "V8Document.h" 27 #include "V8Document.h"
28 #include "V8EventTarget.h"
28 #include "V8MessagePort.h" 29 #include "V8MessagePort.h"
29 #include "V8Node.h" 30 #include "V8Node.h"
30 #include "V8SVGDocument.h" 31 #include "V8SVGDocument.h"
31 #include "V8SVGPoint.h" 32 #include "V8SVGPoint.h"
32 #include "V8TestCallback.h" 33 #include "V8TestCallback.h"
33 #include "V8TestInterface.h" 34 #include "V8TestInterface.h"
34 #include "V8TestNode.h" 35 #include "V8TestNode.h"
35 #include "V8TestObjectectA.h" 36 #include "V8TestObjectectA.h"
36 #include "V8TestObjectectB.h" 37 #include "V8TestObjectectB.h"
37 #include "V8TestObjectectC.h" 38 #include "V8TestObjectectC.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 // In ScriptWrappable::init, the use of a local function declaration has an issu e on Windows: 82 // In ScriptWrappable::init, the use of a local function declaration has an issu e on Windows:
82 // the local declaration does not pick up the surrounding namespace. Therefore, we provide this function 83 // the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
83 // in the global namespace. 84 // in the global namespace.
84 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/fe edback/details/664619/the-namespace-of-local-function-declarations-in-c) 85 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/fe edback/details/664619/the-namespace-of-local-function-declarations-in-c)
85 void webCoreInitializeScriptWrappableForInterface(WebCore::TestObj* object) 86 void webCoreInitializeScriptWrappableForInterface(WebCore::TestObj* object)
86 { 87 {
87 WebCore::initializeScriptWrappableForInterface(object); 88 WebCore::initializeScriptWrappableForInterface(object);
88 } 89 }
89 90
90 namespace WebCore { 91 namespace WebCore {
91 WrapperTypeInfo V8TestObject::info = { V8TestObject::GetTemplate, V8TestObject:: derefObject, 0, 0, 0, V8TestObject::installPerContextPrototypeProperties, 0, Wra pperTypeObjectPrototype }; 92 WrapperTypeInfo V8TestObject::info = { V8TestObject::GetTemplate, V8TestObject:: derefObject, 0, V8TestObject::toEventTarget, 0, V8TestObject::installPerContextP rototypeProperties, &V8EventTarget::info, WrapperTypeObjectPrototype };
92 93
93 namespace TestObjV8Internal { 94 namespace TestObjV8Internal {
94 95
95 template <typename T> void V8_USE(T) { } 96 template <typename T> void V8_USE(T) { }
96 97
97 static void readOnlyLongAttrAttrGetter(v8::Local<v8::String> name, const v8::Pro pertyCallbackInfo<v8::Value>& info) 98 static void readOnlyLongAttrAttrGetter(v8::Local<v8::String> name, const v8::Pro pertyCallbackInfo<v8::Value>& info)
98 { 99 {
99 TestObj* imp = V8TestObject::toNative(info.Holder()); 100 TestObj* imp = V8TestObject::toNative(info.Holder());
100 v8SetReturnValueInt(info, imp->readOnlyLongAttr()); 101 v8SetReturnValueInt(info, imp->readOnlyLongAttr());
101 return; 102 return;
(...skipping 5475 matching lines...) Expand 10 before | Expand all | Expand 10 after
5577 } 5578 }
5578 5579
5579 TestObjV8Internal::constructor(args); 5580 TestObjV8Internal::constructor(args);
5580 } 5581 }
5581 5582
5582 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestObjectTemplate(v8::Handle <v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType currentWorld Type) 5583 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestObjectTemplate(v8::Handle <v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType currentWorld Type)
5583 { 5584 {
5584 desc->ReadOnlyPrototype(); 5585 desc->ReadOnlyPrototype();
5585 5586
5586 v8::Local<v8::Signature> defaultSignature; 5587 v8::Local<v8::Signature> defaultSignature;
5587 defaultSignature = V8DOMConfiguration::configureTemplate(desc, "TestObject", v8::Local<v8::FunctionTemplate>(), V8TestObject::internalFieldCount, 5588 defaultSignature = V8DOMConfiguration::configureTemplate(desc, "TestObject", V8EventTarget::GetTemplate(isolate, currentWorldType), V8TestObject::internalFi eldCount,
5588 V8TestObjectAttrs, WTF_ARRAY_LENGTH(V8TestObjectAttrs), 5589 V8TestObjectAttrs, WTF_ARRAY_LENGTH(V8TestObjectAttrs),
5589 V8TestObjectMethods, WTF_ARRAY_LENGTH(V8TestObjectMethods), isolate, cur rentWorldType); 5590 V8TestObjectMethods, WTF_ARRAY_LENGTH(V8TestObjectMethods), isolate, cur rentWorldType);
5590 UNUSED_PARAM(defaultSignature); // In some cases, it will not be used. 5591 UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
5591 desc->SetCallHandler(V8TestObject::constructorCallback); 5592 desc->SetCallHandler(V8TestObject::constructorCallback);
5592 desc->SetLength(1); 5593 desc->SetLength(1);
5593 v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate(); 5594 v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
5594 v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate(); 5595 v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
5595 UNUSED_PARAM(instance); // In some cases, it will not be used. 5596 UNUSED_PARAM(instance); // In some cases, it will not be used.
5596 UNUSED_PARAM(proto); // In some cases, it will not be used. 5597 UNUSED_PARAM(proto); // In some cases, it will not be used.
5597 if (RuntimeEnabledFeatures::enabledAtRuntimeAttr1Enabled()) { 5598 if (RuntimeEnabledFeatures::enabledAtRuntimeAttr1Enabled()) {
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
5738 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(GetTemplate(i solate, worldType(isolate))); 5739 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(GetTemplate(i solate, worldType(isolate)));
5739 UNUSED_PARAM(defaultSignature); // In some cases, it will not be used. 5740 UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
5740 5741
5741 ScriptExecutionContext* context = toScriptExecutionContext(proto->CreationCo ntext()); 5742 ScriptExecutionContext* context = toScriptExecutionContext(proto->CreationCo ntext());
5742 if (context && context->isDocument() && ContextFeatures::enabledPerContextMe thod1Enabled(toDocument(context))) 5743 if (context && context->isDocument() && ContextFeatures::enabledPerContextMe thod1Enabled(toDocument(context)))
5743 proto->Set(v8::String::NewSymbol("enabledPerContextMethod1"), v8::Functi onTemplate::New(TestObjV8Internal::enabledPerContextMethod1MethodCallback, v8Und efined(), defaultSignature, 1)->GetFunction()); 5744 proto->Set(v8::String::NewSymbol("enabledPerContextMethod1"), v8::Functi onTemplate::New(TestObjV8Internal::enabledPerContextMethod1MethodCallback, v8Und efined(), defaultSignature, 1)->GetFunction());
5744 if (context && context->isDocument() && ContextFeatures::featureNameEnabled( toDocument(context))) 5745 if (context && context->isDocument() && ContextFeatures::featureNameEnabled( toDocument(context)))
5745 proto->Set(v8::String::NewSymbol("enabledPerContextMethod2"), v8::Functi onTemplate::New(TestObjV8Internal::enabledPerContextMethod2MethodCallback, v8Und efined(), defaultSignature, 1)->GetFunction()); 5746 proto->Set(v8::String::NewSymbol("enabledPerContextMethod2"), v8::Functi onTemplate::New(TestObjV8Internal::enabledPerContextMethod2MethodCallback, v8Und efined(), defaultSignature, 1)->GetFunction());
5746 } 5747 }
5747 5748
5749 EventTarget* V8TestObject::toEventTarget(v8::Handle<v8::Object> object)
5750 {
5751 return toNative(object);
5752 }
5753
5748 5754
5749 v8::Handle<v8::Object> V8TestObject::createWrapper(PassRefPtr<TestObj> impl, v8: :Handle<v8::Object> creationContext, v8::Isolate* isolate) 5755 v8::Handle<v8::Object> V8TestObject::createWrapper(PassRefPtr<TestObj> impl, v8: :Handle<v8::Object> creationContext, v8::Isolate* isolate)
5750 { 5756 {
5751 ASSERT(impl.get()); 5757 ASSERT(impl.get());
5752 ASSERT(DOMDataStore::getWrapper<V8TestObject>(impl.get(), isolate).IsEmpty() ); 5758 ASSERT(DOMDataStore::getWrapper<V8TestObject>(impl.get(), isolate).IsEmpty() );
5753 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { 5759 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
5754 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje ct(impl.get()); 5760 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje ct(impl.get());
5755 // Might be a XXXConstructor::info instead of an XXX::info. These will b oth have 5761 // Might be a XXXConstructor::info instead of an XXX::info. These will b oth have
5756 // the same object de-ref functions, though, so use that as the basis of the check. 5762 // the same object de-ref functions, though, so use that as the basis of the check.
5757 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == info.derefObjectFunction); 5763 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == info.derefObjectFunction);
5758 } 5764 }
5759 5765
5760 5766
5761 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext , &info, toInternalPointer(impl.get()), isolate); 5767 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext , &info, toInternalPointer(impl.get()), isolate);
5762 if (UNLIKELY(wrapper.IsEmpty())) 5768 if (UNLIKELY(wrapper.IsEmpty()))
5763 return wrapper; 5769 return wrapper;
5764 installPerContextProperties(wrapper, impl.get(), isolate); 5770 installPerContextProperties(wrapper, impl.get(), isolate);
5765 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl, &info, wrapper, isolate, WrapperConfiguration::Independent); 5771 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl, &info, wrapper, isolate, WrapperConfiguration::Independent);
5766 return wrapper; 5772 return wrapper;
5767 } 5773 }
5768 void V8TestObject::derefObject(void* object) 5774 void V8TestObject::derefObject(void* object)
5769 { 5775 {
5770 fromInternalPointer(object)->deref(); 5776 fromInternalPointer(object)->deref();
5771 } 5777 }
5772 5778
5773 } // namespace WebCore 5779 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698