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

Side by Side Diff: Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.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 V8TestNamedConstructor_h
22 #define V8TestNamedConstructor_h
23
24 #include "TestNamedConstructor.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 V8TestNamedConstructorConstructor {
35 public:
36 static v8::Persistent<v8::FunctionTemplate> GetTemplate(v8::Isolate*, Wrappe rWorldType);
37 static WrapperTypeInfo info;
38 };
39
40 class V8TestNamedConstructor {
41 public:
42 static const bool hasDependentLifetime = true;
43 static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp e);
44 static bool HasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
45 static v8::Persistent<v8::FunctionTemplate> GetTemplate(v8::Isolate*, Wrappe rWorldType);
46 static TestNamedConstructor* toNative(v8::Handle<v8::Object> object)
47 {
48 return reinterpret_cast<TestNamedConstructor*>(object->GetAlignedPointer FromInternalField(v8DOMWrapperObjectIndex));
49 }
50 static void derefObject(void*);
51 static WrapperTypeInfo info;
52 static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>);
53 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0 ;
54 static void installPerContextProperties(v8::Handle<v8::Object>, TestNamedCon structor*, v8::Isolate*) { }
55 static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8: :Isolate*) { }
56 private:
57 friend v8::Handle<v8::Object> wrap(TestNamedConstructor*, v8::Handle<v8::Obj ect> creationContext, v8::Isolate*);
58 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestNamedConstructor> , v8::Handle<v8::Object> creationContext, v8::Isolate*);
59 };
60
61 template<>
62 class WrapperTypeTraits<TestNamedConstructor > {
63 public:
64 static WrapperTypeInfo* info() { return &V8TestNamedConstructor::info; }
65 };
66
67
68 inline v8::Handle<v8::Object> wrap(TestNamedConstructor* impl, v8::Handle<v8::Ob ject> creationContext, v8::Isolate* isolate)
69 {
70 ASSERT(impl);
71 ASSERT(DOMDataStore::getWrapper(impl, isolate).IsEmpty());
72 return V8TestNamedConstructor::createWrapper(impl, creationContext, isolate) ;
73 }
74
75 inline v8::Handle<v8::Value> toV8(TestNamedConstructor* impl, v8::Handle<v8::Obj ect> creationContext, v8::Isolate* isolate)
76 {
77 if (UNLIKELY(!impl))
78 return v8NullWithCheck(isolate);
79 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper(impl, isolate);
80 if (!wrapper.IsEmpty())
81 return wrapper;
82 return wrap(impl, creationContext, isolate);
83 }
84
85 inline v8::Handle<v8::Value> toV8ForMainWorld(TestNamedConstructor* impl, v8::Ha ndle<v8::Object> creationContext, v8::Isolate* isolate)
86 {
87 ASSERT(worldType(isolate) == MainWorld);
88 if (UNLIKELY(!impl))
89 return v8NullWithCheck(isolate);
90 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapperForMainWorld(impl);
91 if (!wrapper.IsEmpty())
92 return wrapper;
93 return wrap(impl, creationContext, isolate);
94 }
95
96 template<class HolderContainer, class Wrappable>
97 inline v8::Handle<v8::Value> toV8Fast(TestNamedConstructor* impl, const HolderCo ntainer& container, Wrappable* wrappable)
98 {
99 if (UNLIKELY(!impl))
100 return v8Null(container.GetIsolate());
101 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperFast(impl, containe r, wrappable);
102 if (!wrapper.IsEmpty())
103 return wrapper;
104 return wrap(impl, container.Holder(), container.GetIsolate());
105 }
106
107 template<class HolderContainer, class Wrappable>
108 inline v8::Handle<v8::Value> toV8FastForMainWorld(TestNamedConstructor* impl, co nst HolderContainer& container, Wrappable* wrappable)
109 {
110 ASSERT(worldType(container.GetIsolate()) == MainWorld);
111 if (UNLIKELY(!impl))
112 return v8Null(container.GetIsolate());
113 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperForMainWorld(impl);
114 if (!wrapper.IsEmpty())
115 return wrapper;
116 return wrap(impl, container.Holder(), container.GetIsolate());
117 }
118
119 template<class HolderContainer, class Wrappable>
120 inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< TestNamedConstruct or > impl, const HolderContainer& container, Wrappable* wrappable)
121 {
122 return toV8FastForMainWorld(impl.get(), container, wrappable);
123 }
124
125
126 template<class HolderContainer, class Wrappable>
127 inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< TestNamedConstructor > impl, c onst HolderContainer& container, Wrappable* wrappable)
128 {
129 return toV8Fast(impl.get(), container, wrappable);
130 }
131
132 inline v8::Handle<v8::Value> toV8(PassRefPtr< TestNamedConstructor > impl, v8::H andle<v8::Object> creationContext, v8::Isolate* isolate)
133 {
134 return toV8(impl.get(), creationContext, isolate);
135 }
136
137 }
138
139 #endif // V8TestNamedConstructor_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698