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

Side by Side Diff: Source/bindings/tests/results/V8TestEvent.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 18 matching lines...) Expand all
29 29
30 namespace WebCore { 30 namespace WebCore {
31 31
32 class V8TestEvent { 32 class V8TestEvent {
33 public: 33 public:
34 static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp e); 34 static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp e);
35 static bool HasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*); 35 static bool HasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
36 static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWor ldType); 36 static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWor ldType);
37 static TestEvent* toNative(v8::Handle<v8::Object> object) 37 static TestEvent* toNative(v8::Handle<v8::Object> object)
38 { 38 {
39 return reinterpret_cast<TestEvent*>(object->GetAlignedPointerFromInterna lField(v8DOMWrapperObjectIndex)); 39 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8 DOMWrapperObjectIndex));
40 } 40 }
41 static void derefObject(void*); 41 static void derefObject(void*);
42 static WrapperTypeInfo info; 42 static WrapperTypeInfo info;
43 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0 ; 43 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0 ;
44 static inline void* toInternalPointer(TestEvent* impl)
45 {
46 return V8Event::toInternalPointer(impl);
47 }
48
49 static inline TestEvent* fromInternalPointer(void* object)
50 {
51 return static_cast<TestEvent*>(V8Event::fromInternalPointer(object));
52 }
44 static void installPerContextProperties(v8::Handle<v8::Object>, TestEvent*, v8::Isolate*) { } 53 static void installPerContextProperties(v8::Handle<v8::Object>, TestEvent*, v8::Isolate*) { }
45 static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8: :Isolate*) { } 54 static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8: :Isolate*) { }
46 private: 55 private:
47 friend v8::Handle<v8::Object> wrap(TestEvent*, v8::Handle<v8::Object> creati onContext, v8::Isolate*); 56 friend v8::Handle<v8::Object> wrap(TestEvent*, v8::Handle<v8::Object> creati onContext, v8::Isolate*);
48 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestEvent>, v8::Handl e<v8::Object> creationContext, v8::Isolate*); 57 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestEvent>, v8::Handl e<v8::Object> creationContext, v8::Isolate*);
49 }; 58 };
50 59
51 template<> 60 template<>
52 class WrapperTypeTraits<TestEvent > { 61 class WrapperTypeTraits<TestEvent > {
53 public: 62 public:
54 static WrapperTypeInfo* info() { return &V8TestEvent::info; } 63 static WrapperTypeInfo* info() { return &V8TestEvent::info; }
55 }; 64 };
56 65
57 66
58 inline v8::Handle<v8::Object> wrap(TestEvent* impl, v8::Handle<v8::Object> creat ionContext, v8::Isolate* isolate) 67 inline v8::Handle<v8::Object> wrap(TestEvent* impl, v8::Handle<v8::Object> creat ionContext, v8::Isolate* isolate)
59 { 68 {
60 ASSERT(impl); 69 ASSERT(impl);
61 ASSERT(DOMDataStore::getWrapper(impl, isolate).IsEmpty()); 70 ASSERT(DOMDataStore::getWrapper<V8TestEvent>(impl, isolate).IsEmpty());
62 if (ScriptWrappable::wrapperCanBeStoredInObject(impl)) { 71 if (ScriptWrappable::wrapperCanBeStoredInObject(impl)) {
63 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje ct(impl); 72 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje ct(impl);
64 // Might be a XXXConstructor::info instead of an XXX::info. These will b oth have 73 // Might be a XXXConstructor::info instead of an XXX::info. These will b oth have
65 // the same object de-ref functions, though, so use that as the basis of the check. 74 // the same object de-ref functions, though, so use that as the basis of the check.
66 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == V8TestEvent::info.derefObjectFunction); 75 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == V8TestEvent::info.derefObjectFunction);
67 } 76 }
68 return V8TestEvent::createWrapper(impl, creationContext, isolate); 77 return V8TestEvent::createWrapper(impl, creationContext, isolate);
69 } 78 }
70 79
71 inline v8::Handle<v8::Value> toV8(TestEvent* impl, v8::Handle<v8::Object> creati onContext, v8::Isolate* isolate) 80 inline v8::Handle<v8::Value> toV8(TestEvent* impl, v8::Handle<v8::Object> creati onContext, v8::Isolate* isolate)
72 { 81 {
73 if (UNLIKELY(!impl)) 82 if (UNLIKELY(!impl))
74 return v8NullWithCheck(isolate); 83 return v8NullWithCheck(isolate);
75 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper(impl, isolate); 84 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestEvent>(impl, isolate);
76 if (!wrapper.IsEmpty()) 85 if (!wrapper.IsEmpty())
77 return wrapper; 86 return wrapper;
78 return wrap(impl, creationContext, isolate); 87 return wrap(impl, creationContext, isolate);
79 } 88 }
80 89
81 inline v8::Handle<v8::Value> toV8ForMainWorld(TestEvent* impl, v8::Handle<v8::Ob ject> creationContext, v8::Isolate* isolate) 90 inline v8::Handle<v8::Value> toV8ForMainWorld(TestEvent* impl, v8::Handle<v8::Ob ject> creationContext, v8::Isolate* isolate)
82 { 91 {
83 ASSERT(worldType(isolate) == MainWorld); 92 ASSERT(worldType(isolate) == MainWorld);
84 if (UNLIKELY(!impl)) 93 if (UNLIKELY(!impl))
85 return v8NullWithCheck(isolate); 94 return v8NullWithCheck(isolate);
86 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapperForMainWorld(impl); 95 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapperForMainWorld<V8TestE vent>(impl);
87 if (!wrapper.IsEmpty()) 96 if (!wrapper.IsEmpty())
88 return wrapper; 97 return wrapper;
89 return wrap(impl, creationContext, isolate); 98 return wrap(impl, creationContext, isolate);
90 } 99 }
91 100
92 template<class HolderContainer, class Wrappable> 101 template<class HolderContainer, class Wrappable>
93 inline v8::Handle<v8::Value> toV8Fast(TestEvent* impl, const HolderContainer& co ntainer, Wrappable* wrappable) 102 inline v8::Handle<v8::Value> toV8Fast(TestEvent* impl, const HolderContainer& co ntainer, Wrappable* wrappable)
94 { 103 {
95 if (UNLIKELY(!impl)) 104 if (UNLIKELY(!impl))
96 return v8::Null(container.GetIsolate()); 105 return v8::Null(container.GetIsolate());
97 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperFast(impl, containe r, wrappable); 106 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperFast<V8TestEvent>(i mpl, container, wrappable);
98 if (!wrapper.IsEmpty()) 107 if (!wrapper.IsEmpty())
99 return wrapper; 108 return wrapper;
100 return wrap(impl, container.Holder(), container.GetIsolate()); 109 return wrap(impl, container.Holder(), container.GetIsolate());
101 } 110 }
102 111
103 template<class HolderContainer, class Wrappable> 112 template<class HolderContainer, class Wrappable>
104 inline v8::Handle<v8::Value> toV8FastForMainWorld(TestEvent* impl, const HolderC ontainer& container, Wrappable* wrappable) 113 inline v8::Handle<v8::Value> toV8FastForMainWorld(TestEvent* impl, const HolderC ontainer& container, Wrappable* wrappable)
105 { 114 {
106 ASSERT(worldType(container.GetIsolate()) == MainWorld); 115 ASSERT(worldType(container.GetIsolate()) == MainWorld);
107 if (UNLIKELY(!impl)) 116 if (UNLIKELY(!impl))
108 return v8::Null(container.GetIsolate()); 117 return v8::Null(container.GetIsolate());
109 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperForMainWorld(impl); 118 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperForMainWorld<V8Test Event>(impl);
110 if (!wrapper.IsEmpty()) 119 if (!wrapper.IsEmpty())
111 return wrapper; 120 return wrapper;
112 return wrap(impl, container.Holder(), container.GetIsolate()); 121 return wrap(impl, container.Holder(), container.GetIsolate());
113 } 122 }
114 123
115 template<class HolderContainer, class Wrappable> 124 template<class HolderContainer, class Wrappable>
116 inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< TestEvent > impl, const HolderContainer& container, Wrappable* wrappable) 125 inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< TestEvent > impl, const HolderContainer& container, Wrappable* wrappable)
117 { 126 {
118 return toV8FastForMainWorld(impl.get(), container, wrappable); 127 return toV8FastForMainWorld(impl.get(), container, wrappable);
119 } 128 }
120 129
121 130
122 template<class HolderContainer, class Wrappable> 131 template<class HolderContainer, class Wrappable>
123 inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< TestEvent > impl, const Holder Container& container, Wrappable* wrappable) 132 inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< TestEvent > impl, const Holder Container& container, Wrappable* wrappable)
124 { 133 {
125 return toV8Fast(impl.get(), container, wrappable); 134 return toV8Fast(impl.get(), container, wrappable);
126 } 135 }
127 136
128 inline v8::Handle<v8::Value> toV8(PassRefPtr< TestEvent > impl, v8::Handle<v8::O bject> creationContext, v8::Isolate* isolate) 137 inline v8::Handle<v8::Value> toV8(PassRefPtr< TestEvent > impl, v8::Handle<v8::O bject> creationContext, v8::Isolate* isolate)
129 { 138 {
130 return toV8(impl.get(), creationContext, isolate); 139 return toV8(impl.get(), creationContext, isolate);
131 } 140 }
132 141
133 } 142 }
134 143
135 #endif // V8TestEvent_h 144 #endif // V8TestEvent_h
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestCustomAccessors.cpp ('k') | Source/bindings/tests/results/V8TestEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698