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

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

Issue 18778002: Inherit EventTarget interface instead of duplicating its code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix the regressions Created 7 years, 5 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,
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 114
115 static void readOnlyStringAttrAttrGetterCallback(v8::Local<v8::String> name, con st v8::PropertyCallbackInfo<v8::Value>& info) 115 static void readOnlyStringAttrAttrGetterCallback(v8::Local<v8::String> name, con st v8::PropertyCallbackInfo<v8::Value>& info)
116 { 116 {
117 TestObjV8Internal::readOnlyStringAttrAttrGetter(name, info); 117 TestObjV8Internal::readOnlyStringAttrAttrGetter(name, info);
118 } 118 }
119 119
120 static void readOnlyTestObjectAttrAttrGetter(v8::Local<v8::String> name, const v 8::PropertyCallbackInfo<v8::Value>& info) 120 static void readOnlyTestObjectAttrAttrGetter(v8::Local<v8::String> name, const v 8::PropertyCallbackInfo<v8::Value>& info)
121 { 121 {
122 TestObj* imp = V8TestObject::toNative(info.Holder()); 122 TestObj* imp = V8TestObject::toNative(info.Holder());
123 RefPtr<TestObj> result = imp->readOnlyTestObjectAttr(); 123 RefPtr<TestObj> result = imp->readOnlyTestObjectAttr();
124 v8::Handle<v8::Value> wrapper = result.get() ? v8::Handle<v8::Value>(DOMData Store::getWrapper(result.get(), info.GetIsolate())) : v8Undefined(); 124 v8::Handle<v8::Value> wrapper = result.get() ? v8::Handle<v8::Value>(DOMData Store::getWrapper<V8TestObject>(result.get(), info.GetIsolate())) : v8Undefined( );
125 if (wrapper.IsEmpty()) { 125 if (wrapper.IsEmpty()) {
126 wrapper = toV8(result.get(), info.Holder(), info.GetIsolate()); 126 wrapper = toV8(result.get(), info.Holder(), info.GetIsolate());
127 if (!wrapper.IsEmpty()) 127 if (!wrapper.IsEmpty())
128 V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "readOn lyTestObjectAttr", wrapper); 128 V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "readOn lyTestObjectAttr", wrapper);
129 } 129 }
130 v8SetReturnValue(info, wrapper); 130 v8SetReturnValue(info, wrapper);
131 return; 131 return;
132 } 132 }
133 133
134 static void readOnlyTestObjectAttrAttrGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info) 134 static void readOnlyTestObjectAttrAttrGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
(...skipping 1991 matching lines...) Expand 10 before | Expand all | Expand 10 after
2126 { 2126 {
2127 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 2127 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
2128 TestObjV8Internal::nullableStringValueAttrSetter(name, value, info); 2128 TestObjV8Internal::nullableStringValueAttrSetter(name, value, info);
2129 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 2129 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2130 } 2130 }
2131 2131
2132 static void perWorldReadOnlyAttributeAttrGetter(v8::Local<v8::String> name, cons t v8::PropertyCallbackInfo<v8::Value>& info) 2132 static void perWorldReadOnlyAttributeAttrGetter(v8::Local<v8::String> name, cons t v8::PropertyCallbackInfo<v8::Value>& info)
2133 { 2133 {
2134 TestObj* imp = V8TestObject::toNative(info.Holder()); 2134 TestObj* imp = V8TestObject::toNative(info.Holder());
2135 RefPtr<TestObj> result = imp->perWorldReadOnlyAttribute(); 2135 RefPtr<TestObj> result = imp->perWorldReadOnlyAttribute();
2136 v8::Handle<v8::Value> wrapper = result.get() ? v8::Handle<v8::Value>(DOMData Store::getWrapper(result.get(), info.GetIsolate())) : v8Undefined(); 2136 v8::Handle<v8::Value> wrapper = result.get() ? v8::Handle<v8::Value>(DOMData Store::getWrapper<V8TestObject>(result.get(), info.GetIsolate())) : v8Undefined( );
2137 if (wrapper.IsEmpty()) { 2137 if (wrapper.IsEmpty()) {
2138 wrapper = toV8(result.get(), info.Holder(), info.GetIsolate()); 2138 wrapper = toV8(result.get(), info.Holder(), info.GetIsolate());
2139 if (!wrapper.IsEmpty()) 2139 if (!wrapper.IsEmpty())
2140 V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "perWor ldReadOnlyAttribute", wrapper); 2140 V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "perWor ldReadOnlyAttribute", wrapper);
2141 } 2141 }
2142 v8SetReturnValue(info, wrapper); 2142 v8SetReturnValue(info, wrapper);
2143 return; 2143 return;
2144 } 2144 }
2145 2145
2146 static void perWorldReadOnlyAttributeAttrGetterCallback(v8::Local<v8::String> na me, const v8::PropertyCallbackInfo<v8::Value>& info) 2146 static void perWorldReadOnlyAttributeAttrGetterCallback(v8::Local<v8::String> na me, const v8::PropertyCallbackInfo<v8::Value>& info)
2147 { 2147 {
2148 TestObjV8Internal::perWorldReadOnlyAttributeAttrGetter(name, info); 2148 TestObjV8Internal::perWorldReadOnlyAttributeAttrGetter(name, info);
2149 } 2149 }
2150 2150
2151 static void perWorldReadOnlyAttributeAttrGetterForMainWorld(v8::Local<v8::String > name, const v8::PropertyCallbackInfo<v8::Value>& info) 2151 static void perWorldReadOnlyAttributeAttrGetterForMainWorld(v8::Local<v8::String > name, const v8::PropertyCallbackInfo<v8::Value>& info)
2152 { 2152 {
2153 TestObj* imp = V8TestObject::toNative(info.Holder()); 2153 TestObj* imp = V8TestObject::toNative(info.Holder());
2154 RefPtr<TestObj> result = imp->perWorldReadOnlyAttribute(); 2154 RefPtr<TestObj> result = imp->perWorldReadOnlyAttribute();
2155 v8::Handle<v8::Value> wrapper = result.get() ? v8::Handle<v8::Value>(DOMData Store::getWrapperForMainWorld(result.get())) : v8Undefined(); 2155 v8::Handle<v8::Value> wrapper = result.get() ? v8::Handle<v8::Value>(DOMData Store::getWrapperForMainWorld<V8TestObject>(result.get())) : v8Undefined();
2156 if (wrapper.IsEmpty()) { 2156 if (wrapper.IsEmpty()) {
2157 wrapper = toV8(result.get(), info.Holder(), info.GetIsolate()); 2157 wrapper = toV8(result.get(), info.Holder(), info.GetIsolate());
2158 if (!wrapper.IsEmpty()) 2158 if (!wrapper.IsEmpty())
2159 V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "perWor ldReadOnlyAttribute", wrapper); 2159 V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "perWor ldReadOnlyAttribute", wrapper);
2160 } 2160 }
2161 v8SetReturnValue(info, wrapper); 2161 v8SetReturnValue(info, wrapper);
2162 return; 2162 return;
2163 } 2163 }
2164 2164
2165 static void perWorldReadOnlyAttributeAttrGetterCallbackForMainWorld(v8::Local<v8 ::String> name, const v8::PropertyCallbackInfo<v8::Value>& info) 2165 static void perWorldReadOnlyAttributeAttrGetterCallbackForMainWorld(v8::Local<v8 ::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
(...skipping 2731 matching lines...) Expand 10 before | Expand all | Expand 10 after
4897 } 4897 }
4898 if (args.Length() <= 0 || !args[0]->IsFunction()) { 4898 if (args.Length() <= 0 || !args[0]->IsFunction()) {
4899 throwTypeError(0, args.GetIsolate()); 4899 throwTypeError(0, args.GetIsolate());
4900 return; 4900 return;
4901 } 4901 }
4902 RefPtr<TestCallback> testCallback = V8TestCallback::create(args[0], getScrip tExecutionContext()); 4902 RefPtr<TestCallback> testCallback = V8TestCallback::create(args[0], getScrip tExecutionContext());
4903 4903
4904 RefPtr<TestObj> impl = TestObj::create(testCallback); 4904 RefPtr<TestObj> impl = TestObj::create(testCallback);
4905 v8::Handle<v8::Object> wrapper = args.Holder(); 4905 v8::Handle<v8::Object> wrapper = args.Holder();
4906 4906
4907 V8DOMWrapper::associateObjectWithWrapper(impl.release(), &V8TestObject::info , wrapper, args.GetIsolate(), WrapperConfiguration::Dependent); 4907 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl.release(), &V8Te stObject::info, wrapper, args.GetIsolate(), WrapperConfiguration::Dependent);
4908 args.GetReturnValue().Set(wrapper); 4908 args.GetReturnValue().Set(wrapper);
4909 } 4909 }
4910 4910
4911 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo <v8::Value>& info) 4911 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo <v8::Value>& info)
4912 { 4912 {
4913 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder())); 4913 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder()));
4914 TestObj* collection = V8TestObject::toNative(info.Holder()); 4914 TestObj* collection = V8TestObject::toNative(info.Holder());
4915 RefPtr<Node> element = collection->item(index); 4915 RefPtr<Node> element = collection->item(index);
4916 if (!element) 4916 if (!element)
4917 return; 4917 return;
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
5479 if (context && context->isDocument() && ContextFeatures::enabledPerContextMe thod1Enabled(toDocument(context))) 5479 if (context && context->isDocument() && ContextFeatures::enabledPerContextMe thod1Enabled(toDocument(context)))
5480 proto->Set(v8::String::NewSymbol("enabledPerContextMethod1"), v8::Functi onTemplate::New(TestObjV8Internal::enabledPerContextMethod1MethodCallback, v8Und efined(), defaultSignature, 1)->GetFunction()); 5480 proto->Set(v8::String::NewSymbol("enabledPerContextMethod1"), v8::Functi onTemplate::New(TestObjV8Internal::enabledPerContextMethod1MethodCallback, v8Und efined(), defaultSignature, 1)->GetFunction());
5481 if (context && context->isDocument() && ContextFeatures::featureNameEnabled( toDocument(context))) 5481 if (context && context->isDocument() && ContextFeatures::featureNameEnabled( toDocument(context)))
5482 proto->Set(v8::String::NewSymbol("enabledPerContextMethod2"), v8::Functi onTemplate::New(TestObjV8Internal::enabledPerContextMethod2MethodCallback, v8Und efined(), defaultSignature, 1)->GetFunction()); 5482 proto->Set(v8::String::NewSymbol("enabledPerContextMethod2"), v8::Functi onTemplate::New(TestObjV8Internal::enabledPerContextMethod2MethodCallback, v8Und efined(), defaultSignature, 1)->GetFunction());
5483 } 5483 }
5484 5484
5485 5485
5486 v8::Handle<v8::Object> V8TestObject::createWrapper(PassRefPtr<TestObj> impl, v8: :Handle<v8::Object> creationContext, v8::Isolate* isolate) 5486 v8::Handle<v8::Object> V8TestObject::createWrapper(PassRefPtr<TestObj> impl, v8: :Handle<v8::Object> creationContext, v8::Isolate* isolate)
5487 { 5487 {
5488 ASSERT(impl.get()); 5488 ASSERT(impl.get());
5489 ASSERT(DOMDataStore::getWrapper(impl.get(), isolate).IsEmpty()); 5489 ASSERT(DOMDataStore::getWrapper<V8TestObject>(impl.get(), isolate).IsEmpty() );
5490 5490
5491 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext , &info, impl.get(), isolate); 5491 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext , &info, toWrappedType(impl.get()), isolate);
5492 if (UNLIKELY(wrapper.IsEmpty())) 5492 if (UNLIKELY(wrapper.IsEmpty()))
5493 return wrapper; 5493 return wrapper;
5494 installPerContextProperties(wrapper, impl.get(), isolate); 5494 installPerContextProperties(wrapper, impl.get(), isolate);
5495 V8DOMWrapper::associateObjectWithWrapper(impl, &info, wrapper, isolate, Wrap perConfiguration::Independent); 5495 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl, &info, wrapper, isolate, WrapperConfiguration::Independent);
5496 return wrapper; 5496 return wrapper;
5497 } 5497 }
5498 void V8TestObject::derefObject(void* object) 5498 void V8TestObject::derefObject(void* object)
5499 { 5499 {
5500 static_cast<TestObj*>(object)->deref(); 5500 fromWrappedType(object)->deref();
5501 } 5501 }
5502 5502
5503 } // namespace WebCore 5503 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698