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

Side by Side Diff: Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.h

Issue 13937004: Move bindings-tests to bindings/tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 /*
2 This file is part of the WebKit open source project.
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY!
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
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
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19 */
20
21 #ifndef V8TestEventTarget_h
22 #define V8TestEventTarget_h
23
24 #include "TestEventTarget.h"
25 #include "V8Binding.h"
26 #include "V8DOMWrapper.h"
27 #include "WrapperTypeInfo.h"
28 #include <v8.h>
29 #include <wtf/HashMap.h>
30 #include <wtf/text/StringHash.h>
31
32 namespace WebCore {
33
34 class V8TestEventTarget {
35 public:
36 static const bool hasDependentLifetime = false;
37 static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp e);
38 static bool HasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
39 static v8::Persistent<v8::FunctionTemplate> GetTemplate(v8::Isolate*, Wrappe rWorldType);
40 static TestEventTarget* toNative(v8::Handle<v8::Object> object)
41 {
42 return reinterpret_cast<TestEventTarget*>(object->GetAlignedPointerFromI nternalField(v8DOMWrapperObjectIndex));
43 }
44 static void derefObject(void*);
45 static WrapperTypeInfo info;
46 static EventTarget* toEventTarget(v8::Handle<v8::Object>);
47 static v8::Handle<v8::Value> indexedPropertyGetter(uint32_t, const v8::Acces sorInfo&);
48 static v8::Handle<v8::Value> namedPropertyGetter(v8::Local<v8::String>, cons t v8::AccessorInfo&);
49 static const int eventListenerCacheIndex = v8DefaultWrapperInternalFieldCoun t + 0;
50 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 1 ;
51 static void installPerContextProperties(v8::Handle<v8::Object>, TestEventTar get*, v8::Isolate*) { }
52 static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8: :Isolate*) { }
53 private:
54 friend v8::Handle<v8::Object> wrap(TestEventTarget*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
55 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestEventTarget>, v8: :Handle<v8::Object> creationContext, v8::Isolate*);
56 };
57
58 template<>
59 class WrapperTypeTraits<TestEventTarget > {
60 public:
61 static WrapperTypeInfo* info() { return &V8TestEventTarget::info; }
62 };
63
64
65 inline v8::Handle<v8::Object> wrap(TestEventTarget* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
66 {
67 ASSERT(impl);
68 ASSERT(DOMDataStore::getWrapper(impl, isolate).IsEmpty());
69 return V8TestEventTarget::createWrapper(impl, creationContext, isolate);
70 }
71
72 inline v8::Handle<v8::Value> toV8(TestEventTarget* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
73 {
74 if (UNLIKELY(!impl))
75 return v8NullWithCheck(isolate);
76 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper(impl, isolate);
77 if (!wrapper.IsEmpty())
78 return wrapper;
79 return wrap(impl, creationContext, isolate);
80 }
81
82 inline v8::Handle<v8::Value> toV8ForMainWorld(TestEventTarget* impl, v8::Handle< v8::Object> creationContext, v8::Isolate* isolate)
83 {
84 ASSERT(worldType(isolate) == MainWorld);
85 if (UNLIKELY(!impl))
86 return v8NullWithCheck(isolate);
87 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapperForMainWorld(impl);
88 if (!wrapper.IsEmpty())
89 return wrapper;
90 return wrap(impl, creationContext, isolate);
91 }
92
93 template<class HolderContainer, class Wrappable>
94 inline v8::Handle<v8::Value> toV8Fast(TestEventTarget* impl, const HolderContain er& container, Wrappable* wrappable)
95 {
96 if (UNLIKELY(!impl))
97 return v8Null(container.GetIsolate());
98 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperFast(impl, containe r, wrappable);
99 if (!wrapper.IsEmpty())
100 return wrapper;
101 return wrap(impl, container.Holder(), container.GetIsolate());
102 }
103
104 template<class HolderContainer, class Wrappable>
105 inline v8::Handle<v8::Value> toV8FastForMainWorld(TestEventTarget* impl, const H olderContainer& container, Wrappable* wrappable)
106 {
107 ASSERT(worldType(container.GetIsolate()) == MainWorld);
108 if (UNLIKELY(!impl))
109 return v8Null(container.GetIsolate());
110 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperForMainWorld(impl);
111 if (!wrapper.IsEmpty())
112 return wrapper;
113 return wrap(impl, container.Holder(), container.GetIsolate());
114 }
115
116 template<class HolderContainer, class Wrappable>
117 inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< TestEventTarget > impl, const HolderContainer& container, Wrappable* wrappable)
118 {
119 return toV8FastForMainWorld(impl.get(), container, wrappable);
120 }
121
122
123 template<class HolderContainer, class Wrappable>
124 inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< TestEventTarget > impl, const HolderContainer& container, Wrappable* wrappable)
125 {
126 return toV8Fast(impl.get(), container, wrappable);
127 }
128
129 inline v8::Handle<v8::Value> toV8(PassRefPtr< TestEventTarget > impl, v8::Handle <v8::Object> creationContext, v8::Isolate* isolate)
130 {
131 return toV8(impl.get(), creationContext, isolate);
132 }
133
134 }
135
136 #endif // V8TestEventTarget_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698