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

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

Issue 14261002: Make generator function data path more clear. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: revised Created 7 years, 8 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
OLDNEW
1 /* 1 /*
2 This file is part of the WebKit open source project. 2 This file is part of the WebKit open source project.
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY! 3 This file has been generated by generate-bindings.pl. 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 const int dispatchEventArgc = 1; 195 const int dispatchEventArgc = 1;
196 v8::Handle<v8::FunctionTemplate> dispatchEventArgv[dispatchEventArgc] = { V8 PerIsolateData::from(isolate)->rawTemplate(&V8Event::info, currentWorldType) }; 196 v8::Handle<v8::FunctionTemplate> dispatchEventArgv[dispatchEventArgc] = { V8 PerIsolateData::from(isolate)->rawTemplate(&V8Event::info, currentWorldType) };
197 v8::Handle<v8::Signature> dispatchEventSignature = v8::Signature::New(desc, dispatchEventArgc, dispatchEventArgv); 197 v8::Handle<v8::Signature> dispatchEventSignature = v8::Signature::New(desc, dispatchEventArgc, dispatchEventArgv);
198 proto->Set(v8::String::NewSymbol("dispatchEvent"), v8::FunctionTemplate::New (TestEventTargetV8Internal::dispatchEventMethodCallback, v8Undefined(), dispatch EventSignature)); 198 proto->Set(v8::String::NewSymbol("dispatchEvent"), v8::FunctionTemplate::New (TestEventTargetV8Internal::dispatchEventMethodCallback, v8Undefined(), dispatch EventSignature));
199 199
200 // Custom toString template 200 // Custom toString template
201 desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->to StringTemplate()); 201 desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->to StringTemplate());
202 return desc; 202 return desc;
203 } 203 }
204 204
205 v8::Handle<v8::Value> V8TestEventTarget::namedPropertyGetter(v8::Local<v8::Strin g> name, const v8::AccessorInfo& info)
206 {
207 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty())
208 return v8Undefined();
209 if (info.Holder()->HasRealNamedCallbackProperty(name))
210 return v8Undefined();
211
212 v8::Local<v8::Object> object = info.Holder();
213 v8::Handle<v8::Object> creationContext = info.Holder();
214 v8::Isolate* isolate = info.GetIsolate();
215
216 ASSERT(V8DOMWrapper::maybeDOMWrapper(object));
217 ASSERT(toWrapperTypeInfo(object) != &V8Node::info);
218 TestEventTarget* collection = toNative(object);
219
220 AtomicString propertyName = toWebCoreAtomicStringWithNullCheck(name);
221 RefPtr<Node> element = collection->namedItem(propertyName);
222
223 if (!element)
224 return v8Undefined();
225
226 return toV8(element.release(), creationContext, isolate);
227 }
228
205 v8::Persistent<v8::FunctionTemplate> V8TestEventTarget::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType) 229 v8::Persistent<v8::FunctionTemplate> V8TestEventTarget::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
206 { 230 {
207 V8PerIsolateData* data = V8PerIsolateData::from(isolate); 231 V8PerIsolateData* data = V8PerIsolateData::from(isolate);
208 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo rldType).find(&info); 232 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo rldType).find(&info);
209 if (result != data->templateMap(currentWorldType).end()) 233 if (result != data->templateMap(currentWorldType).end())
210 return result->value; 234 return result->value;
211 235
212 v8::HandleScope handleScope; 236 v8::HandleScope handleScope;
213 v8::Persistent<v8::FunctionTemplate> templ = 237 v8::Persistent<v8::FunctionTemplate> templ =
214 ConfigureV8TestEventTargetTemplate(data->rawTemplate(&info, currentWorld Type), isolate, currentWorldType); 238 ConfigureV8TestEventTargetTemplate(data->rawTemplate(&info, currentWorld Type), isolate, currentWorldType);
(...skipping 11 matching lines...) Expand all
226 return V8PerIsolateData::from(isolate)->hasInstance(&info, value, MainWorld) 250 return V8PerIsolateData::from(isolate)->hasInstance(&info, value, MainWorld)
227 || V8PerIsolateData::from(isolate)->hasInstance(&info, value, IsolatedWo rld) 251 || V8PerIsolateData::from(isolate)->hasInstance(&info, value, IsolatedWo rld)
228 || V8PerIsolateData::from(isolate)->hasInstance(&info, value, WorkerWorl d); 252 || V8PerIsolateData::from(isolate)->hasInstance(&info, value, WorkerWorl d);
229 } 253 }
230 254
231 EventTarget* V8TestEventTarget::toEventTarget(v8::Handle<v8::Object> object) 255 EventTarget* V8TestEventTarget::toEventTarget(v8::Handle<v8::Object> object)
232 { 256 {
233 return toNative(object); 257 return toNative(object);
234 } 258 }
235 259
236 v8::Handle<v8::Value> V8TestEventTarget::namedPropertyGetter(v8::Local<v8::Strin g> name, const v8::AccessorInfo& info)
237 {
238 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty())
239 return v8Undefined();
240 if (info.Holder()->HasRealNamedCallbackProperty(name))
241 return v8Undefined();
242
243 v8::Local<v8::Object> object = info.Holder();
244 v8::Handle<v8::Object> creationContext = info.Holder();
245 v8::Isolate* isolate = info.GetIsolate();
246
247 ASSERT(V8DOMWrapper::maybeDOMWrapper(object));
248 ASSERT(toWrapperTypeInfo(object) != &V8Node::info);
249 TestEventTarget* collection = toNative(object);
250
251 AtomicString propertyName = toWebCoreAtomicStringWithNullCheck(name);
252 RefPtr<Node> element = collection->namedItem(propertyName);
253
254 if (!element)
255 return v8Undefined();
256
257 return toV8(element.release(), creationContext, isolate);
258 }
259 260
260 v8::Handle<v8::Object> V8TestEventTarget::createWrapper(PassRefPtr<TestEventTarg et> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 261 v8::Handle<v8::Object> V8TestEventTarget::createWrapper(PassRefPtr<TestEventTarg et> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
261 { 262 {
262 ASSERT(impl.get()); 263 ASSERT(impl.get());
263 ASSERT(DOMDataStore::getWrapper(impl.get(), isolate).IsEmpty()); 264 ASSERT(DOMDataStore::getWrapper(impl.get(), isolate).IsEmpty());
264 265
265 #if ENABLE(BINDING_INTEGRITY) 266 #if ENABLE(BINDING_INTEGRITY)
266 checkTypeOrDieTrying(impl.get()); 267 checkTypeOrDieTrying(impl.get());
267 #endif 268 #endif
268 269
269 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext , &info, impl.get(), isolate); 270 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext , &info, impl.get(), isolate);
270 if (UNLIKELY(wrapper.IsEmpty())) 271 if (UNLIKELY(wrapper.IsEmpty()))
271 return wrapper; 272 return wrapper;
272 273
273 installPerContextProperties(wrapper, impl.get(), isolate); 274 installPerContextProperties(wrapper, impl.get(), isolate);
274 V8DOMWrapper::associateObjectWithWrapper(impl, &info, wrapper, isolate, hasD ependentLifetime ? WrapperConfiguration::Dependent : WrapperConfiguration::Indep endent); 275 V8DOMWrapper::associateObjectWithWrapper(impl, &info, wrapper, isolate, hasD ependentLifetime ? WrapperConfiguration::Dependent : WrapperConfiguration::Indep endent);
275 return wrapper; 276 return wrapper;
276 } 277 }
277 void V8TestEventTarget::derefObject(void* object) 278 void V8TestEventTarget::derefObject(void* object)
278 { 279 {
279 static_cast<TestEventTarget*>(object)->deref(); 280 static_cast<TestEventTarget*>(object)->deref();
280 } 281 }
281 282
282 } // namespace WebCore 283 } // namespace WebCore
OLDNEW
« Source/bindings/scripts/CodeGeneratorV8.pm ('K') | « Source/bindings/scripts/CodeGeneratorV8.pm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698