| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 114 |
| 115 static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) | 115 static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) |
| 116 { | 116 { |
| 117 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); | 117 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); |
| 118 TestSpecialOperationsAnonymousV8Internal::indexedPropertyDeleter(index, info
); | 118 TestSpecialOperationsAnonymousV8Internal::indexedPropertyDeleter(index, info
); |
| 119 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 119 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 120 } | 120 } |
| 121 | 121 |
| 122 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa
llbackInfo<v8::Value>& info) | 122 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa
llbackInfo<v8::Value>& info) |
| 123 { | 123 { |
| 124 if (info.Holder()->HasRealNamedProperty(name)) |
| 125 return; |
| 124 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) | 126 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) |
| 125 return; | 127 return; |
| 126 if (info.Holder()->HasRealNamedCallbackProperty(name)) | |
| 127 return; | |
| 128 if (info.Holder()->HasRealNamedProperty(name)) | |
| 129 return; | |
| 130 | 128 |
| 131 TestSpecialOperationsAnonymous* collection = V8TestSpecialOperationsAnonymou
s::toNative(info.Holder()); | 129 TestSpecialOperationsAnonymous* collection = V8TestSpecialOperationsAnonymou
s::toNative(info.Holder()); |
| 132 AtomicString propertyName = toCoreAtomicString(name); | 130 AtomicString propertyName = toCoreAtomicString(name); |
| 133 String element = collection->anonymousNamedGetter(propertyName); | 131 String element = collection->anonymousNamedGetter(propertyName); |
| 134 if (element.isNull()) | 132 if (element.isNull()) |
| 135 return; | 133 return; |
| 136 v8SetReturnValueString(info, element, info.GetIsolate()); | 134 v8SetReturnValueString(info, element, info.GetIsolate()); |
| 137 } | 135 } |
| 138 | 136 |
| 139 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr
opertyCallbackInfo<v8::Value>& info) | 137 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr
opertyCallbackInfo<v8::Value>& info) |
| 140 { | 138 { |
| 141 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 139 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
| 142 TestSpecialOperationsAnonymousV8Internal::namedPropertyGetter(name, info); | 140 TestSpecialOperationsAnonymousV8Internal::namedPropertyGetter(name, info); |
| 143 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 141 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 144 } | 142 } |
| 145 | 143 |
| 146 static void namedPropertySetter(v8::Local<v8::String> name, v8::Local<v8::Value>
jsValue, const v8::PropertyCallbackInfo<v8::Value>& info) | 144 static void namedPropertySetter(v8::Local<v8::String> name, v8::Local<v8::Value>
jsValue, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 147 { | 145 { |
| 146 if (info.Holder()->HasRealNamedProperty(name)) |
| 147 return; |
| 148 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) | 148 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) |
| 149 return; | 149 return; |
| 150 if (info.Holder()->HasRealNamedCallbackProperty(name)) | |
| 151 return; | |
| 152 if (info.Holder()->HasRealNamedProperty(name)) | |
| 153 return; | |
| 154 | 150 |
| 155 TestSpecialOperationsAnonymous* collection = V8TestSpecialOperationsAnonymou
s::toNative(info.Holder()); | 151 TestSpecialOperationsAnonymous* collection = V8TestSpecialOperationsAnonymou
s::toNative(info.Holder()); |
| 156 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyName, name)
; | 152 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyName, name)
; |
| 157 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyValue, jsVa
lue); | 153 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyValue, jsVa
lue); |
| 158 bool result = collection->anonymousNamedSetter(propertyName, propertyValue); | 154 bool result = collection->anonymousNamedSetter(propertyName, propertyValue); |
| 159 if (!result) | 155 if (!result) |
| 160 return; | 156 return; |
| 161 v8SetReturnValue(info, jsValue); | 157 v8SetReturnValue(info, jsValue); |
| 162 } | 158 } |
| 163 | 159 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 fromInternalPointer(object)->deref(); | 288 fromInternalPointer(object)->deref(); |
| 293 } | 289 } |
| 294 | 290 |
| 295 template<> | 291 template<> |
| 296 v8::Handle<v8::Value> toV8NoInline(TestSpecialOperationsAnonymous* impl, v8::Han
dle<v8::Object> creationContext, v8::Isolate* isolate) | 292 v8::Handle<v8::Value> toV8NoInline(TestSpecialOperationsAnonymous* impl, v8::Han
dle<v8::Object> creationContext, v8::Isolate* isolate) |
| 297 { | 293 { |
| 298 return toV8(impl, creationContext, isolate); | 294 return toV8(impl, creationContext, isolate); |
| 299 } | 295 } |
| 300 | 296 |
| 301 } // namespace WebCore | 297 } // namespace WebCore |
| OLD | NEW |