OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 190 |
191 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A
rray>& info) | 191 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A
rray>& info) |
192 { | 192 { |
193 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 193 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
194 TestSpecialOperationsIntV8Internal::namedPropertyEnumerator(info); | 194 TestSpecialOperationsIntV8Internal::namedPropertyEnumerator(info); |
195 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 195 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
196 } | 196 } |
197 | 197 |
198 } // namespace TestSpecialOperationsIntV8Internal | 198 } // namespace TestSpecialOperationsIntV8Internal |
199 | 199 |
200 static void configureV8TestSpecialOperationsIntTemplate(v8::Handle<v8::FunctionT
emplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldTy
pe) | 200 static void configureV8TestSpecialOperationsIntTemplate(v8::Handle<v8::FunctionT
emplate> functionTemplate, v8::Isolate* isolate) |
201 { | 201 { |
202 functionTemplate->ReadOnlyPrototype(); | 202 functionTemplate->ReadOnlyPrototype(); |
203 | 203 |
204 v8::Local<v8::Signature> defaultSignature; | 204 v8::Local<v8::Signature> defaultSignature; |
205 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestSpecialOperationsInt", v8::Local<v8::FunctionTemplate>(), V8TestSpecia
lOperationsInt::internalFieldCount, | 205 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestSpecialOperationsInt", v8::Local<v8::FunctionTemplate>(), V8TestSpecia
lOperationsInt::internalFieldCount, |
206 0, 0, | 206 0, 0, |
207 0, 0, | 207 0, 0, |
208 0, 0, | 208 0, 0, |
209 isolate, currentWorldType); | 209 isolate); |
210 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); | 210 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
211 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); | 211 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
212 functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestSpecialO
perationsIntV8Internal::indexedPropertyGetterCallback, TestSpecialOperationsIntV
8Internal::indexedPropertySetterCallback, 0, 0, indexedPropertyEnumerator<TestSp
ecialOperationsInt>); | 212 functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestSpecialO
perationsIntV8Internal::indexedPropertyGetterCallback, TestSpecialOperationsIntV
8Internal::indexedPropertySetterCallback, 0, 0, indexedPropertyEnumerator<TestSp
ecialOperationsInt>); |
213 functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestSpecialOpe
rationsIntV8Internal::namedPropertyGetterCallback, TestSpecialOperationsIntV8Int
ernal::namedPropertySetterCallback, TestSpecialOperationsIntV8Internal::namedPro
pertyQueryCallback, 0, TestSpecialOperationsIntV8Internal::namedPropertyEnumerat
orCallback); | 213 functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestSpecialOpe
rationsIntV8Internal::namedPropertyGetterCallback, TestSpecialOperationsIntV8Int
ernal::namedPropertySetterCallback, TestSpecialOperationsIntV8Internal::namedPro
pertyQueryCallback, 0, TestSpecialOperationsIntV8Internal::namedPropertyEnumerat
orCallback); |
214 | 214 |
215 // Custom toString template | 215 // Custom toString template |
216 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:current()->toStringTemplate()); | 216 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:current()->toStringTemplate()); |
217 } | 217 } |
218 | 218 |
219 v8::Handle<v8::FunctionTemplate> V8TestSpecialOperationsInt::domTemplate(v8::Iso
late* isolate, WrapperWorldType currentWorldType) | 219 v8::Handle<v8::FunctionTemplate> V8TestSpecialOperationsInt::domTemplate(v8::Iso
late* isolate) |
220 { | 220 { |
221 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 221 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
222 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); | 222 V8PerIsolateData::TemplateMap::iterator result = data->templateMap().find(&w
rapperTypeInfo); |
223 if (result != data->templateMap(currentWorldType).end()) | 223 if (result != data->templateMap().end()) |
224 return result->value.newLocal(isolate); | 224 return result->value.newLocal(isolate); |
225 | 225 |
226 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); | 226 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); |
227 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V
8ObjectConstructor::isValidConstructorMode); | 227 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V
8ObjectConstructor::isValidConstructorMode); |
228 configureV8TestSpecialOperationsIntTemplate(templ, isolate, currentWorldType
); | 228 configureV8TestSpecialOperationsIntTemplate(templ, isolate); |
229 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); | 229 data->templateMap().add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTempl
ate>(isolate, templ)); |
230 return templ; | 230 return templ; |
231 } | 231 } |
232 | 232 |
233 bool V8TestSpecialOperationsInt::hasInstance(v8::Handle<v8::Value> jsValue, v8::
Isolate* isolate) | 233 bool V8TestSpecialOperationsInt::hasInstance(v8::Handle<v8::Value> jsValue, v8::
Isolate* isolate) |
234 { | 234 { |
235 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e); | 235 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e); |
236 } | 236 } |
237 | 237 |
238 v8::Handle<v8::Object> V8TestSpecialOperationsInt::findInstanceInPrototypeChain(
v8::Handle<v8::Value> jsValue, v8::Isolate* isolate) | 238 v8::Handle<v8::Object> V8TestSpecialOperationsInt::findInstanceInPrototypeChain(
v8::Handle<v8::Value> jsValue, v8::Isolate* isolate) |
239 { | 239 { |
(...skipping 30 matching lines...) Expand all Loading... |
270 fromInternalPointer(object)->deref(); | 270 fromInternalPointer(object)->deref(); |
271 } | 271 } |
272 | 272 |
273 template<> | 273 template<> |
274 v8::Handle<v8::Value> toV8NoInline(TestSpecialOperationsInt* impl, v8::Handle<v8
::Object> creationContext, v8::Isolate* isolate) | 274 v8::Handle<v8::Value> toV8NoInline(TestSpecialOperationsInt* impl, v8::Handle<v8
::Object> creationContext, v8::Isolate* isolate) |
275 { | 275 { |
276 return toV8(impl, creationContext, isolate); | 276 return toV8(impl, creationContext, isolate); |
277 } | 277 } |
278 | 278 |
279 } // namespace WebCore | 279 } // namespace WebCore |
OLD | NEW |