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

Side by Side Diff: Source/bindings/tests/results/V8TestExtendedEvent.h

Issue 18778002: Inherit EventTarget interface instead of duplicating its code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master 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 19 matching lines...) Expand all
30 30
31 namespace WebCore { 31 namespace WebCore {
32 32
33 class V8TestExtendedEvent { 33 class V8TestExtendedEvent {
34 public: 34 public:
35 static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp e); 35 static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp e);
36 static bool HasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*); 36 static bool HasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
37 static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWor ldType); 37 static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWor ldType);
38 static Event* toNative(v8::Handle<v8::Object> object) 38 static Event* toNative(v8::Handle<v8::Object> object)
39 { 39 {
40 return reinterpret_cast<Event*>(object->GetAlignedPointerFromInternalFie ld(v8DOMWrapperObjectIndex)); 40 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8 DOMWrapperObjectIndex));
41 } 41 }
42 static void derefObject(void*); 42 static void derefObject(void*);
43 static WrapperTypeInfo info; 43 static WrapperTypeInfo info;
44 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0 ; 44 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0 ;
45 static inline void* toInternalPointer(Event* impl)
46 {
47 return V8TestEvent::toInternalPointer(impl);
48 }
49
50 static inline Event* fromInternalPointer(void* object)
51 {
52 return static_cast<Event*>(V8TestEvent::fromInternalPointer(object));
53 }
45 static void installPerContextProperties(v8::Handle<v8::Object>, Event*, v8:: Isolate*) { } 54 static void installPerContextProperties(v8::Handle<v8::Object>, Event*, v8:: Isolate*) { }
46 static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8: :Isolate*) { } 55 static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8: :Isolate*) { }
47 private: 56 private:
48 friend v8::Handle<v8::Object> wrap(Event*, v8::Handle<v8::Object> creationCo ntext, v8::Isolate*); 57 friend v8::Handle<v8::Object> wrap(Event*, v8::Handle<v8::Object> creationCo ntext, v8::Isolate*);
49 static v8::Handle<v8::Object> createWrapper(PassRefPtr<Event>, v8::Handle<v8 ::Object> creationContext, v8::Isolate*); 58 static v8::Handle<v8::Object> createWrapper(PassRefPtr<Event>, v8::Handle<v8 ::Object> creationContext, v8::Isolate*);
50 }; 59 };
51 60
52 template<> 61 template<>
53 class WrapperTypeTraits<Event > { 62 class WrapperTypeTraits<Event > {
54 public: 63 public:
55 static WrapperTypeInfo* info() { return &V8TestExtendedEvent::info; } 64 static WrapperTypeInfo* info() { return &V8TestExtendedEvent::info; }
56 }; 65 };
57 66
58 67
59 inline v8::Handle<v8::Object> wrap(Event* impl, v8::Handle<v8::Object> creationC ontext, v8::Isolate* isolate) 68 inline v8::Handle<v8::Object> wrap(Event* impl, v8::Handle<v8::Object> creationC ontext, v8::Isolate* isolate)
60 { 69 {
61 ASSERT(impl); 70 ASSERT(impl);
62 ASSERT(DOMDataStore::getWrapper(impl, isolate).IsEmpty()); 71 ASSERT(DOMDataStore::getWrapper<V8TestExtendedEvent>(impl, isolate).IsEmpty( ));
63 if (ScriptWrappable::wrapperCanBeStoredInObject(impl)) { 72 if (ScriptWrappable::wrapperCanBeStoredInObject(impl)) {
64 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje ct(impl); 73 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje ct(impl);
65 // Might be a XXXConstructor::info instead of an XXX::info. These will b oth have 74 // Might be a XXXConstructor::info instead of an XXX::info. These will b oth have
66 // the same object de-ref functions, though, so use that as the basis of the check. 75 // the same object de-ref functions, though, so use that as the basis of the check.
67 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == V8TestExtendedEvent::info.derefObjectFunction); 76 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == V8TestExtendedEvent::info.derefObjectFunction);
68 } 77 }
69 return V8TestExtendedEvent::createWrapper(impl, creationContext, isolate); 78 return V8TestExtendedEvent::createWrapper(impl, creationContext, isolate);
70 } 79 }
71 80
72 inline v8::Handle<v8::Value> toV8(Event* impl, v8::Handle<v8::Object> creationCo ntext, v8::Isolate* isolate) 81 inline v8::Handle<v8::Value> toV8(Event* impl, v8::Handle<v8::Object> creationCo ntext, v8::Isolate* isolate)
73 { 82 {
74 if (UNLIKELY(!impl)) 83 if (UNLIKELY(!impl))
75 return v8NullWithCheck(isolate); 84 return v8NullWithCheck(isolate);
76 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper(impl, isolate); 85 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestExtendedEvent >(impl, isolate);
77 if (!wrapper.IsEmpty()) 86 if (!wrapper.IsEmpty())
78 return wrapper; 87 return wrapper;
79 return wrap(impl, creationContext, isolate); 88 return wrap(impl, creationContext, isolate);
80 } 89 }
81 90
82 inline v8::Handle<v8::Value> toV8ForMainWorld(Event* impl, v8::Handle<v8::Object > creationContext, v8::Isolate* isolate) 91 inline v8::Handle<v8::Value> toV8ForMainWorld(Event* impl, v8::Handle<v8::Object > creationContext, v8::Isolate* isolate)
83 { 92 {
84 ASSERT(worldType(isolate) == MainWorld); 93 ASSERT(worldType(isolate) == MainWorld);
85 if (UNLIKELY(!impl)) 94 if (UNLIKELY(!impl))
86 return v8NullWithCheck(isolate); 95 return v8NullWithCheck(isolate);
87 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapperForMainWorld(impl); 96 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapperForMainWorld<V8TestE xtendedEvent>(impl);
88 if (!wrapper.IsEmpty()) 97 if (!wrapper.IsEmpty())
89 return wrapper; 98 return wrapper;
90 return wrap(impl, creationContext, isolate); 99 return wrap(impl, creationContext, isolate);
91 } 100 }
92 101
93 template<class HolderContainer, class Wrappable> 102 template<class HolderContainer, class Wrappable>
94 inline v8::Handle<v8::Value> toV8Fast(Event* impl, const HolderContainer& contai ner, Wrappable* wrappable) 103 inline v8::Handle<v8::Value> toV8Fast(Event* impl, const HolderContainer& contai ner, Wrappable* wrappable)
95 { 104 {
96 if (UNLIKELY(!impl)) 105 if (UNLIKELY(!impl))
97 return v8::Null(container.GetIsolate()); 106 return v8::Null(container.GetIsolate());
98 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperFast(impl, containe r, wrappable); 107 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperFast<V8TestExtended Event>(impl, container, wrappable);
99 if (!wrapper.IsEmpty()) 108 if (!wrapper.IsEmpty())
100 return wrapper; 109 return wrapper;
101 return wrap(impl, container.Holder(), container.GetIsolate()); 110 return wrap(impl, container.Holder(), container.GetIsolate());
102 } 111 }
103 112
104 template<class HolderContainer, class Wrappable> 113 template<class HolderContainer, class Wrappable>
105 inline v8::Handle<v8::Value> toV8FastForMainWorld(Event* impl, const HolderConta iner& container, Wrappable* wrappable) 114 inline v8::Handle<v8::Value> toV8FastForMainWorld(Event* impl, const HolderConta iner& container, Wrappable* wrappable)
106 { 115 {
107 ASSERT(worldType(container.GetIsolate()) == MainWorld); 116 ASSERT(worldType(container.GetIsolate()) == MainWorld);
108 if (UNLIKELY(!impl)) 117 if (UNLIKELY(!impl))
109 return v8::Null(container.GetIsolate()); 118 return v8::Null(container.GetIsolate());
110 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperForMainWorld(impl); 119 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperForMainWorld<V8Test ExtendedEvent>(impl);
111 if (!wrapper.IsEmpty()) 120 if (!wrapper.IsEmpty())
112 return wrapper; 121 return wrapper;
113 return wrap(impl, container.Holder(), container.GetIsolate()); 122 return wrap(impl, container.Holder(), container.GetIsolate());
114 } 123 }
115 124
116 template<class HolderContainer, class Wrappable> 125 template<class HolderContainer, class Wrappable>
117 inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< Event > impl, cons t HolderContainer& container, Wrappable* wrappable) 126 inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< Event > impl, cons t HolderContainer& container, Wrappable* wrappable)
118 { 127 {
119 return toV8FastForMainWorld(impl.get(), container, wrappable); 128 return toV8FastForMainWorld(impl.get(), container, wrappable);
120 } 129 }
121 130
122 131
123 template<class HolderContainer, class Wrappable> 132 template<class HolderContainer, class Wrappable>
124 inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< Event > impl, const HolderCont ainer& container, Wrappable* wrappable) 133 inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< Event > impl, const HolderCont ainer& container, Wrappable* wrappable)
125 { 134 {
126 return toV8Fast(impl.get(), container, wrappable); 135 return toV8Fast(impl.get(), container, wrappable);
127 } 136 }
128 137
129 inline v8::Handle<v8::Value> toV8(PassRefPtr< Event > impl, v8::Handle<v8::Objec t> creationContext, v8::Isolate* isolate) 138 inline v8::Handle<v8::Value> toV8(PassRefPtr< Event > impl, v8::Handle<v8::Objec t> creationContext, v8::Isolate* isolate)
130 { 139 {
131 return toV8(impl.get(), creationContext, isolate); 140 return toV8(impl.get(), creationContext, isolate);
132 } 141 }
133 142
134 } 143 }
135 144
136 #endif // ENABLE(TEST) 145 #endif // ENABLE(TEST)
137 146
138 #endif // V8TestExtendedEvent_h 147 #endif // V8TestExtendedEvent_h
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestException.cpp ('k') | Source/bindings/tests/results/V8TestExtendedEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698