| 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 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 static void treatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeSe
tterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::Prop
ertyCallbackInfo<void>& info) | 495 static void treatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeSe
tterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::Prop
ertyCallbackInfo<void>& info) |
| 496 { | 496 { |
| 497 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 497 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 498 TestObjV8Internal::treatNullAsNullStringTreatUndefinedAsNullStringStringAttr
AttributeSetter(jsValue, info); | 498 TestObjV8Internal::treatNullAsNullStringTreatUndefinedAsNullStringStringAttr
AttributeSetter(jsValue, info); |
| 499 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 499 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 500 } | 500 } |
| 501 | 501 |
| 502 static void eventHandlerAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) | 502 static void eventHandlerAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) |
| 503 { | 503 { |
| 504 TestObj* imp = V8TestObject::toNative(info.Holder()); | 504 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 505 EventListener* jsValue = imp->eventHandlerAttr(isolatedWorldForIsolate(info.
GetIsolate())); | 505 EventListener* jsValue = imp->eventHandlerAttr(); |
| 506 v8SetReturnValue(info, jsValue ? v8::Handle<v8::Value>(V8AbstractEventListen
er::cast(jsValue)->getListenerObject(imp->executionContext())) : v8::Handle<v8::
Value>(v8::Null(info.GetIsolate()))); | 506 v8SetReturnValue(info, jsValue ? v8::Handle<v8::Value>(V8AbstractEventListen
er::cast(jsValue)->getListenerObject(imp->executionContext())) : v8::Handle<v8::
Value>(v8::Null(info.GetIsolate()))); |
| 507 } | 507 } |
| 508 | 508 |
| 509 static void eventHandlerAttrAttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) | 509 static void eventHandlerAttrAttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) |
| 510 { | 510 { |
| 511 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 511 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 512 TestObjV8Internal::eventHandlerAttrAttributeGetter(info); | 512 TestObjV8Internal::eventHandlerAttrAttributeGetter(info); |
| 513 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 513 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 514 } | 514 } |
| 515 | 515 |
| 516 static void eventHandlerAttrAttributeSetter(v8::Local<v8::Value> jsValue, const
v8::PropertyCallbackInfo<void>& info) | 516 static void eventHandlerAttrAttributeSetter(v8::Local<v8::Value> jsValue, const
v8::PropertyCallbackInfo<void>& info) |
| 517 { | 517 { |
| 518 TestObj* imp = V8TestObject::toNative(info.Holder()); | 518 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 519 moveEventListenerToNewWrapper(info.Holder(), imp->eventHandlerAttr(isolatedW
orldForIsolate(info.GetIsolate())), jsValue, V8TestObject::eventListenerCacheInd
ex, info.GetIsolate()); | 519 moveEventListenerToNewWrapper(info.Holder(), imp->eventHandlerAttr(), jsValu
e, V8TestObject::eventListenerCacheIndex, info.GetIsolate()); |
| 520 imp->setEventHandlerAttr(V8EventListenerList::getEventListener(jsValue, true
, ListenerFindOrCreate), isolatedWorldForIsolate(info.GetIsolate())); | 520 imp->setEventHandlerAttr(V8EventListenerList::getEventListener(jsValue, true
, ListenerFindOrCreate)); |
| 521 } | 521 } |
| 522 | 522 |
| 523 static void eventHandlerAttrAttributeSetterCallback(v8::Local<v8::String>, v8::L
ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 523 static void eventHandlerAttrAttributeSetterCallback(v8::Local<v8::String>, v8::L
ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 524 { | 524 { |
| 525 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 525 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 526 TestObjV8Internal::eventHandlerAttrAttributeSetter(jsValue, info); | 526 TestObjV8Internal::eventHandlerAttrAttributeSetter(jsValue, info); |
| 527 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 527 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 528 } | 528 } |
| 529 | 529 |
| 530 static void testObjAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>
& info) | 530 static void testObjAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>
& info) |
| (...skipping 5071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5602 fromInternalPointer(object)->deref(); | 5602 fromInternalPointer(object)->deref(); |
| 5603 } | 5603 } |
| 5604 | 5604 |
| 5605 template<> | 5605 template<> |
| 5606 v8::Handle<v8::Value> toV8NoInline(TestObj* impl, v8::Handle<v8::Object> creatio
nContext, v8::Isolate* isolate) | 5606 v8::Handle<v8::Value> toV8NoInline(TestObj* impl, v8::Handle<v8::Object> creatio
nContext, v8::Isolate* isolate) |
| 5607 { | 5607 { |
| 5608 return toV8(impl, creationContext, isolate); | 5608 return toV8(impl, creationContext, isolate); |
| 5609 } | 5609 } |
| 5610 | 5610 |
| 5611 } // namespace WebCore | 5611 } // namespace WebCore |
| OLD | NEW |