| 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 | 218 |
| 219 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A
rray>& info) | 219 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A
rray>& info) |
| 220 { | 220 { |
| 221 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 221 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
| 222 TestSpecialOperationsAnonymousV8Internal::namedPropertyEnumerator(info); | 222 TestSpecialOperationsAnonymousV8Internal::namedPropertyEnumerator(info); |
| 223 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 223 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 224 } | 224 } |
| 225 | 225 |
| 226 } // namespace TestSpecialOperationsAnonymousV8Internal | 226 } // namespace TestSpecialOperationsAnonymousV8Internal |
| 227 | 227 |
| 228 static void configureV8TestSpecialOperationsAnonymousTemplate(v8::Handle<v8::Fun
ctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentW
orldType) | 228 static void configureV8TestSpecialOperationsAnonymousTemplate(v8::Handle<v8::Fun
ctionTemplate> functionTemplate, v8::Isolate* isolate) |
| 229 { | 229 { |
| 230 functionTemplate->ReadOnlyPrototype(); | 230 functionTemplate->ReadOnlyPrototype(); |
| 231 | 231 |
| 232 v8::Local<v8::Signature> defaultSignature; | 232 v8::Local<v8::Signature> defaultSignature; |
| 233 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestSpecialOperationsAnonymous", v8::Local<v8::FunctionTemplate>(), V8Test
SpecialOperationsAnonymous::internalFieldCount, | 233 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestSpecialOperationsAnonymous", v8::Local<v8::FunctionTemplate>(), V8Test
SpecialOperationsAnonymous::internalFieldCount, |
| 234 0, 0, | 234 0, 0, |
| 235 0, 0, | 235 0, 0, |
| 236 0, 0, | 236 0, 0, |
| 237 isolate, currentWorldType); | 237 isolate); |
| 238 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); | 238 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
| 239 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); | 239 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
| 240 functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestSpecialO
perationsAnonymousV8Internal::indexedPropertyGetterCallback, TestSpecialOperatio
nsAnonymousV8Internal::indexedPropertySetterCallback, 0, TestSpecialOperationsAn
onymousV8Internal::indexedPropertyDeleterCallback, indexedPropertyEnumerator<Tes
tSpecialOperationsAnonymous>); | 240 functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestSpecialO
perationsAnonymousV8Internal::indexedPropertyGetterCallback, TestSpecialOperatio
nsAnonymousV8Internal::indexedPropertySetterCallback, 0, TestSpecialOperationsAn
onymousV8Internal::indexedPropertyDeleterCallback, indexedPropertyEnumerator<Tes
tSpecialOperationsAnonymous>); |
| 241 functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestSpecialOpe
rationsAnonymousV8Internal::namedPropertyGetterCallback, TestSpecialOperationsAn
onymousV8Internal::namedPropertySetterCallback, TestSpecialOperationsAnonymousV8
Internal::namedPropertyQueryCallback, TestSpecialOperationsAnonymousV8Internal::
namedPropertyDeleterCallback, TestSpecialOperationsAnonymousV8Internal::namedPro
pertyEnumeratorCallback); | 241 functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestSpecialOpe
rationsAnonymousV8Internal::namedPropertyGetterCallback, TestSpecialOperationsAn
onymousV8Internal::namedPropertySetterCallback, TestSpecialOperationsAnonymousV8
Internal::namedPropertyQueryCallback, TestSpecialOperationsAnonymousV8Internal::
namedPropertyDeleterCallback, TestSpecialOperationsAnonymousV8Internal::namedPro
pertyEnumeratorCallback); |
| 242 | 242 |
| 243 // Custom toString template | 243 // Custom toString template |
| 244 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:current()->toStringTemplate()); | 244 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:current()->toStringTemplate()); |
| 245 } | 245 } |
| 246 | 246 |
| 247 v8::Handle<v8::FunctionTemplate> V8TestSpecialOperationsAnonymous::domTemplate(v
8::Isolate* isolate, WrapperWorldType currentWorldType) | 247 v8::Handle<v8::FunctionTemplate> V8TestSpecialOperationsAnonymous::domTemplate(v
8::Isolate* isolate) |
| 248 { | 248 { |
| 249 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 249 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
| 250 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); | 250 V8PerIsolateData::TemplateMap::iterator result = data->templateMap().find(&w
rapperTypeInfo); |
| 251 if (result != data->templateMap(currentWorldType).end()) | 251 if (result != data->templateMap().end()) |
| 252 return result->value.newLocal(isolate); | 252 return result->value.newLocal(isolate); |
| 253 | 253 |
| 254 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); | 254 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); |
| 255 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V
8ObjectConstructor::isValidConstructorMode); | 255 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V
8ObjectConstructor::isValidConstructorMode); |
| 256 configureV8TestSpecialOperationsAnonymousTemplate(templ, isolate, currentWor
ldType); | 256 configureV8TestSpecialOperationsAnonymousTemplate(templ, isolate); |
| 257 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); | 257 data->templateMap().add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTempl
ate>(isolate, templ)); |
| 258 return templ; | 258 return templ; |
| 259 } | 259 } |
| 260 | 260 |
| 261 bool V8TestSpecialOperationsAnonymous::hasInstance(v8::Handle<v8::Value> jsValue
, v8::Isolate* isolate) | 261 bool V8TestSpecialOperationsAnonymous::hasInstance(v8::Handle<v8::Value> jsValue
, v8::Isolate* isolate) |
| 262 { | 262 { |
| 263 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e); | 263 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e); |
| 264 } | 264 } |
| 265 | 265 |
| 266 v8::Handle<v8::Object> V8TestSpecialOperationsAnonymous::findInstanceInPrototype
Chain(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate) | 266 v8::Handle<v8::Object> V8TestSpecialOperationsAnonymous::findInstanceInPrototype
Chain(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate) |
| 267 { | 267 { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 298 fromInternalPointer(object)->deref(); | 298 fromInternalPointer(object)->deref(); |
| 299 } | 299 } |
| 300 | 300 |
| 301 template<> | 301 template<> |
| 302 v8::Handle<v8::Value> toV8NoInline(TestSpecialOperationsAnonymous* impl, v8::Han
dle<v8::Object> creationContext, v8::Isolate* isolate) | 302 v8::Handle<v8::Value> toV8NoInline(TestSpecialOperationsAnonymous* impl, v8::Han
dle<v8::Object> creationContext, v8::Isolate* isolate) |
| 303 { | 303 { |
| 304 return toV8(impl, creationContext, isolate); | 304 return toV8(impl, creationContext, isolate); |
| 305 } | 305 } |
| 306 | 306 |
| 307 } // namespace WebCore | 307 } // namespace WebCore |
| OLD | NEW |