| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 106 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
| 107 { | 107 { |
| 108 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 108 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 109 TestEventTargetV8Internal::namedItemMethod(info); | 109 TestEventTargetV8Internal::namedItemMethod(info); |
| 110 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 110 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 111 } | 111 } |
| 112 | 112 |
| 113 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) | 113 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) |
| 114 { | 114 { |
| 115 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder())); | |
| 116 TestEventTarget* collection = V8TestEventTarget::toNative(info.Holder()); | 115 TestEventTarget* collection = V8TestEventTarget::toNative(info.Holder()); |
| 117 RefPtr<Node> element = collection->item(index); | 116 RefPtr<Node> element = collection->item(index); |
| 118 if (!element) | 117 if (!element) |
| 119 return; | 118 return; |
| 120 v8SetReturnValueFast(info, element.release(), collection); | 119 v8SetReturnValueFast(info, element.release(), collection); |
| 121 } | 120 } |
| 122 | 121 |
| 123 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall
backInfo<v8::Value>& info) | 122 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall
backInfo<v8::Value>& info) |
| 124 { | 123 { |
| 125 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); | 124 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 | 163 |
| 165 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa
llbackInfo<v8::Value>& info) | 164 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa
llbackInfo<v8::Value>& info) |
| 166 { | 165 { |
| 167 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) | 166 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) |
| 168 return; | 167 return; |
| 169 if (info.Holder()->HasRealNamedCallbackProperty(name)) | 168 if (info.Holder()->HasRealNamedCallbackProperty(name)) |
| 170 return; | 169 return; |
| 171 if (info.Holder()->HasRealNamedProperty(name)) | 170 if (info.Holder()->HasRealNamedProperty(name)) |
| 172 return; | 171 return; |
| 173 | 172 |
| 174 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder())); | |
| 175 TestEventTarget* collection = V8TestEventTarget::toNative(info.Holder()); | 173 TestEventTarget* collection = V8TestEventTarget::toNative(info.Holder()); |
| 176 AtomicString propertyName = toCoreAtomicString(name); | 174 AtomicString propertyName = toCoreAtomicString(name); |
| 177 RefPtr<Node> element = collection->namedItem(propertyName); | 175 RefPtr<Node> element = collection->namedItem(propertyName); |
| 178 if (!element) | 176 if (!element) |
| 179 return; | 177 return; |
| 180 v8SetReturnValueFast(info, element.release(), collection); | 178 v8SetReturnValueFast(info, element.release(), collection); |
| 181 } | 179 } |
| 182 | 180 |
| 183 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr
opertyCallbackInfo<v8::Value>& info) | 181 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr
opertyCallbackInfo<v8::Value>& info) |
| 184 { | 182 { |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 fromInternalPointer(object)->deref(); | 347 fromInternalPointer(object)->deref(); |
| 350 } | 348 } |
| 351 | 349 |
| 352 template<> | 350 template<> |
| 353 v8::Handle<v8::Value> toV8NoInline(TestEventTarget* impl, v8::Handle<v8::Object>
creationContext, v8::Isolate* isolate) | 351 v8::Handle<v8::Value> toV8NoInline(TestEventTarget* impl, v8::Handle<v8::Object>
creationContext, v8::Isolate* isolate) |
| 354 { | 352 { |
| 355 return toV8(impl, creationContext, isolate); | 353 return toV8(impl, creationContext, isolate); |
| 356 } | 354 } |
| 357 | 355 |
| 358 } // namespace WebCore | 356 } // namespace WebCore |
| OLD | NEW |