OLD | NEW |
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 21 matching lines...) Expand all Loading... |
32 #include "core/dom/ContextFeatures.h" | 32 #include "core/dom/ContextFeatures.h" |
33 #include "core/dom/Document.h" | 33 #include "core/dom/Document.h" |
34 #include "platform/TraceEvent.h" | 34 #include "platform/TraceEvent.h" |
35 #include "wtf/UnusedParam.h" | 35 #include "wtf/UnusedParam.h" |
36 | 36 |
37 namespace WebCore { | 37 namespace WebCore { |
38 | 38 |
39 static void initializeScriptWrappableForInterface(TestEventConstructor* object) | 39 static void initializeScriptWrappableForInterface(TestEventConstructor* object) |
40 { | 40 { |
41 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 41 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
42 ScriptWrappable::setTypeInfoInObject(object, &V8TestEventConstructor::in
fo); | 42 ScriptWrappable::setTypeInfoInObject(object, &V8TestEventConstructor::wr
apperTypeInfo); |
43 else | 43 else |
44 ASSERT_NOT_REACHED(); | 44 ASSERT_NOT_REACHED(); |
45 } | 45 } |
46 | 46 |
47 } // namespace WebCore | 47 } // namespace WebCore |
48 | 48 |
49 // In ScriptWrappable::init, the use of a local function declaration has an issu
e on Windows: | 49 // In ScriptWrappable::init, the use of a local function declaration has an issu
e on Windows: |
50 // the local declaration does not pick up the surrounding namespace. Therefore,
we provide this function | 50 // the local declaration does not pick up the surrounding namespace. Therefore,
we provide this function |
51 // in the global namespace. | 51 // in the global namespace. |
52 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/fe
edback/details/664619/the-namespace-of-local-function-declarations-in-c) | 52 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/fe
edback/details/664619/the-namespace-of-local-function-declarations-in-c) |
53 void webCoreInitializeScriptWrappableForInterface(WebCore::TestEventConstructor*
object) | 53 void webCoreInitializeScriptWrappableForInterface(WebCore::TestEventConstructor*
object) |
54 { | 54 { |
55 WebCore::initializeScriptWrappableForInterface(object); | 55 WebCore::initializeScriptWrappableForInterface(object); |
56 } | 56 } |
57 | 57 |
58 namespace WebCore { | 58 namespace WebCore { |
59 WrapperTypeInfo V8TestEventConstructor::info = { V8TestEventConstructor::GetTemp
late, V8TestEventConstructor::derefObject, 0, 0, 0, V8TestEventConstructor::inst
allPerContextEnabledPrototypeProperties, 0, WrapperTypeObjectPrototype }; | 59 WrapperTypeInfo V8TestEventConstructor::wrapperTypeInfo = { V8TestEventConstruct
or::GetTemplate, V8TestEventConstructor::derefObject, 0, 0, 0, V8TestEventConstr
uctor::installPerContextEnabledPrototypeProperties, 0, WrapperTypeObjectPrototyp
e }; |
60 | 60 |
61 namespace TestEventConstructorV8Internal { | 61 namespace TestEventConstructorV8Internal { |
62 | 62 |
63 template <typename T> void V8_USE(T) { } | 63 template <typename T> void V8_USE(T) { } |
64 | 64 |
65 static void attr1AttributeGetter(v8::Local<v8::String> name, const v8::PropertyC
allbackInfo<v8::Value>& info) | 65 static void attr1AttributeGetter(v8::Local<v8::String> name, const v8::PropertyC
allbackInfo<v8::Value>& info) |
66 { | 66 { |
67 TestEventConstructor* imp = V8TestEventConstructor::toNative(info.Holder()); | 67 TestEventConstructor* imp = V8TestEventConstructor::toNative(info.Holder()); |
68 v8SetReturnValueString(info, imp->attr1(), info.GetIsolate()); | 68 v8SetReturnValueString(info, imp->attr1(), info.GetIsolate()); |
69 } | 69 } |
(...skipping 28 matching lines...) Expand all Loading... |
98 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, args[0]); | 98 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, args[0]); |
99 TestEventConstructorInit eventInit; | 99 TestEventConstructorInit eventInit; |
100 if (args.Length() >= 2) { | 100 if (args.Length() >= 2) { |
101 V8TRYCATCH_VOID(Dictionary, options, Dictionary(args[1], args.GetIsolate
())); | 101 V8TRYCATCH_VOID(Dictionary, options, Dictionary(args[1], args.GetIsolate
())); |
102 if (!fillTestEventConstructorInit(eventInit, options)) | 102 if (!fillTestEventConstructorInit(eventInit, options)) |
103 return; | 103 return; |
104 } | 104 } |
105 | 105 |
106 RefPtr<TestEventConstructor> event = TestEventConstructor::create(type, even
tInit); | 106 RefPtr<TestEventConstructor> event = TestEventConstructor::create(type, even
tInit); |
107 v8::Handle<v8::Object> wrapper = args.Holder(); | 107 v8::Handle<v8::Object> wrapper = args.Holder(); |
108 V8DOMWrapper::associateObjectWithWrapper<V8TestEventConstructor>(event.relea
se(), &V8TestEventConstructor::info, wrapper, args.GetIsolate(), WrapperConfigur
ation::Dependent); | 108 V8DOMWrapper::associateObjectWithWrapper<V8TestEventConstructor>(event.relea
se(), &V8TestEventConstructor::wrapperTypeInfo, wrapper, args.GetIsolate(), Wrap
perConfiguration::Dependent); |
109 v8SetReturnValue(args, wrapper); | 109 v8SetReturnValue(args, wrapper); |
110 } | 110 } |
111 } // namespace TestEventConstructorV8Internal | 111 } // namespace TestEventConstructorV8Internal |
112 | 112 |
113 static const V8DOMConfiguration::AttributeConfiguration V8TestEventConstructorAt
tributes[] = { | 113 static const V8DOMConfiguration::AttributeConfiguration V8TestEventConstructorAt
tributes[] = { |
114 {"attr1", TestEventConstructorV8Internal::attr1AttributeGetterCallback, 0, 0
, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAtt
ribute>(v8::None), 0 /* on instance */}, | 114 {"attr1", TestEventConstructorV8Internal::attr1AttributeGetterCallback, 0, 0
, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAtt
ribute>(v8::None), 0 /* on instance */}, |
115 {"attr2", TestEventConstructorV8Internal::attr2AttributeGetterCallback, 0, 0
, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAtt
ribute>(v8::None), 0 /* on instance */}, | 115 {"attr2", TestEventConstructorV8Internal::attr2AttributeGetterCallback, 0, 0
, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAtt
ribute>(v8::None), 0 /* on instance */}, |
116 }; | 116 }; |
117 | 117 |
118 bool fillTestEventConstructorInit(TestEventConstructorInit& eventInit, const Dic
tionary& options) | 118 bool fillTestEventConstructorInit(TestEventConstructorInit& eventInit, const Dic
tionary& options) |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 desc->SetLength(1); | 150 desc->SetLength(1); |
151 | 151 |
152 // Custom toString template | 152 // Custom toString template |
153 desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->to
StringTemplate()); | 153 desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->to
StringTemplate()); |
154 return desc; | 154 return desc; |
155 } | 155 } |
156 | 156 |
157 v8::Handle<v8::FunctionTemplate> V8TestEventConstructor::GetTemplate(v8::Isolate
* isolate, WrapperWorldType currentWorldType) | 157 v8::Handle<v8::FunctionTemplate> V8TestEventConstructor::GetTemplate(v8::Isolate
* isolate, WrapperWorldType currentWorldType) |
158 { | 158 { |
159 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 159 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
160 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&info); | 160 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); |
161 if (result != data->templateMap(currentWorldType).end()) | 161 if (result != data->templateMap(currentWorldType).end()) |
162 return result->value.newLocal(isolate); | 162 return result->value.newLocal(isolate); |
163 | 163 |
164 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); | 164 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); |
165 v8::HandleScope handleScope(isolate); | 165 v8::HandleScope handleScope(isolate); |
166 v8::Handle<v8::FunctionTemplate> templ = | 166 v8::Handle<v8::FunctionTemplate> templ = |
167 ConfigureV8TestEventConstructorTemplate(data->rawTemplate(&info, current
WorldType), isolate, currentWorldType); | 167 ConfigureV8TestEventConstructorTemplate(data->rawTemplate(&wrapperTypeIn
fo, currentWorldType), isolate, currentWorldType); |
168 data->templateMap(currentWorldType).add(&info, UnsafePersistent<v8::Function
Template>(isolate, templ)); | 168 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); |
169 return handleScope.Close(templ); | 169 return handleScope.Close(templ); |
170 } | 170 } |
171 | 171 |
172 bool V8TestEventConstructor::HasInstance(v8::Handle<v8::Value> jsValue, v8::Isol
ate* isolate, WrapperWorldType currentWorldType) | 172 bool V8TestEventConstructor::HasInstance(v8::Handle<v8::Value> jsValue, v8::Isol
ate* isolate, WrapperWorldType currentWorldType) |
173 { | 173 { |
174 return V8PerIsolateData::from(isolate)->hasInstance(&info, jsValue, currentW
orldType); | 174 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, currentWorldType); |
175 } | 175 } |
176 | 176 |
177 bool V8TestEventConstructor::HasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue
, v8::Isolate* isolate) | 177 bool V8TestEventConstructor::HasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue
, v8::Isolate* isolate) |
178 { | 178 { |
179 return V8PerIsolateData::from(isolate)->hasInstance(&info, jsValue, MainWorl
d) | 179 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, MainWorld) |
180 || V8PerIsolateData::from(isolate)->hasInstance(&info, jsValue, Isolated
World) | 180 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, IsolatedWorld) |
181 || V8PerIsolateData::from(isolate)->hasInstance(&info, jsValue, WorkerWo
rld); | 181 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, WorkerWorld); |
182 } | 182 } |
183 | 183 |
184 v8::Handle<v8::Object> V8TestEventConstructor::createWrapper(PassRefPtr<TestEven
tConstructor> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate
) | 184 v8::Handle<v8::Object> V8TestEventConstructor::createWrapper(PassRefPtr<TestEven
tConstructor> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate
) |
185 { | 185 { |
186 ASSERT(impl); | 186 ASSERT(impl); |
187 ASSERT(!DOMDataStore::containsWrapper<V8TestEventConstructor>(impl.get(), is
olate)); | 187 ASSERT(!DOMDataStore::containsWrapper<V8TestEventConstructor>(impl.get(), is
olate)); |
188 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { | 188 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { |
189 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl.get()); | 189 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl.get()); |
190 // Might be a XXXConstructor::info instead of an XXX::info. These will b
oth have | 190 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper
TypeInfo. These will both have |
191 // the same object de-ref functions, though, so use that as the basis of
the check. | 191 // the same object de-ref functions, though, so use that as the basis of
the check. |
192 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== info.derefObjectFunction); | 192 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== wrapperTypeInfo.derefObjectFunction); |
193 } | 193 } |
194 | 194 |
195 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &info, toInternalPointer(impl.get()), isolate); | 195 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate); |
196 if (UNLIKELY(wrapper.IsEmpty())) | 196 if (UNLIKELY(wrapper.IsEmpty())) |
197 return wrapper; | 197 return wrapper; |
198 | 198 |
199 installPerContextEnabledProperties(wrapper, impl.get(), isolate); | 199 installPerContextEnabledProperties(wrapper, impl.get(), isolate); |
200 V8DOMWrapper::associateObjectWithWrapper<V8TestEventConstructor>(impl, &info
, wrapper, isolate, WrapperConfiguration::Independent); | 200 V8DOMWrapper::associateObjectWithWrapper<V8TestEventConstructor>(impl, &wrap
perTypeInfo, wrapper, isolate, WrapperConfiguration::Independent); |
201 return wrapper; | 201 return wrapper; |
202 } | 202 } |
203 | 203 |
204 void V8TestEventConstructor::derefObject(void* object) | 204 void V8TestEventConstructor::derefObject(void* object) |
205 { | 205 { |
206 fromInternalPointer(object)->deref(); | 206 fromInternalPointer(object)->deref(); |
207 } | 207 } |
208 | 208 |
209 } // namespace WebCore | 209 } // namespace WebCore |
OLD | NEW |