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

Side by Side Diff: trunk/Source/bindings/tests/results/V8TestEventTarget.h

Issue 218813002: Revert 170357 "Revert of Make DOMWrapperWorld::current() return ..." (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 6 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 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6
7 #ifndef V8TestEventTarget_h
8 #define V8TestEventTarget_h
9
10 #include "V8EventTarget.h"
11 #include "bindings/tests/idls/TestEventTarget.h"
12 #include "bindings/v8/V8Binding.h"
13 #include "bindings/v8/V8DOMWrapper.h"
14 #include "bindings/v8/WrapperTypeInfo.h"
15 #include "heap/Handle.h"
16
17 namespace WebCore {
18
19 class V8TestEventTarget {
20 public:
21 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*);
22 static v8::Handle<v8::Object> findInstanceInPrototypeChain(v8::Handle<v8::Va lue>, v8::Isolate*);
23 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*);
24 static TestEventTarget* toNative(v8::Handle<v8::Object> object)
25 {
26 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8 DOMWrapperObjectIndex));
27 }
28 static TestEventTarget* toNativeWithTypeCheck(v8::Isolate*, v8::Handle<v8::V alue>);
29 static const WrapperTypeInfo wrapperTypeInfo;
30 static void derefObject(void*);
31 static EventTarget* toEventTarget(v8::Handle<v8::Object>);
32 static const int eventListenerCacheIndex = v8DefaultWrapperInternalFieldCoun t + 0;
33 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 1 ;
34 static inline void* toInternalPointer(TestEventTarget* impl)
35 {
36 return V8EventTarget::toInternalPointer(impl);
37 }
38
39 static inline TestEventTarget* fromInternalPointer(void* object)
40 {
41 return static_cast<TestEventTarget*>(V8EventTarget::fromInternalPointer( object));
42 }
43 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestE ventTarget*, v8::Isolate*) { }
44 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol ate*) { }
45
46 private:
47 friend v8::Handle<v8::Object> wrap(TestEventTarget*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
48 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestEventTarget>, v8: :Handle<v8::Object> creationContext, v8::Isolate*);
49 };
50
51 inline v8::Handle<v8::Object> wrap(TestEventTarget* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
52 {
53 ASSERT(impl);
54 ASSERT(!DOMDataStore::containsWrapper<V8TestEventTarget>(impl, isolate));
55 return V8TestEventTarget::createWrapper(impl, creationContext, isolate);
56 }
57
58 inline v8::Handle<v8::Value> toV8(TestEventTarget* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
59 {
60 if (UNLIKELY(!impl))
61 return v8::Null(isolate);
62 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestEventTarget>( impl, isolate);
63 if (!wrapper.IsEmpty())
64 return wrapper;
65 return wrap(impl, creationContext, isolate);
66 }
67
68 template<typename CallbackInfo>
69 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestEventTarget* impl)
70 {
71 if (UNLIKELY(!impl)) {
72 v8SetReturnValueNull(callbackInfo);
73 return;
74 }
75 if (DOMDataStore::setReturnValueFromWrapper<V8TestEventTarget>(callbackInfo. GetReturnValue(), impl))
76 return;
77 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI nfo.GetIsolate());
78 v8SetReturnValue(callbackInfo, wrapper);
79 }
80
81 template<typename CallbackInfo>
82 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestE ventTarget* impl)
83 {
84 ASSERT(DOMWrapperWorld::current(callbackInfo.GetIsolate())->isMainWorld());
85 if (UNLIKELY(!impl)) {
86 v8SetReturnValueNull(callbackInfo);
87 return;
88 }
89 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestEventTarget>(c allbackInfo.GetReturnValue(), impl))
90 return;
91 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackIn fo.GetIsolate());
92 v8SetReturnValue(callbackInfo, wrapper);
93 }
94
95 template<class CallbackInfo, class Wrappable>
96 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestEventTarg et* impl, Wrappable* wrappable)
97 {
98 if (UNLIKELY(!impl)) {
99 v8SetReturnValueNull(callbackInfo);
100 return;
101 }
102 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestEventTarget>(callbackI nfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
103 return;
104 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI nfo.GetIsolate());
105 v8SetReturnValue(callbackInfo, wrapper);
106 }
107
108 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestEventTarget> impl, v8::Handle<v 8::Object> creationContext, v8::Isolate* isolate)
109 {
110 return toV8(impl.get(), creationContext, isolate);
111 }
112
113 template<class CallbackInfo>
114 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestEv entTarget> impl)
115 {
116 v8SetReturnValue(callbackInfo, impl.get());
117 }
118
119 template<class CallbackInfo>
120 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR efPtr<TestEventTarget> impl)
121 {
122 v8SetReturnValueForMainWorld(callbackInfo, impl.get());
123 }
124
125 template<class CallbackInfo, class Wrappable>
126 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te stEventTarget> impl, Wrappable* wrappable)
127 {
128 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
129 }
130
131 }
132 #endif // V8TestEventTarget_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698