| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 66 |
| 67 namespace WebCore { | 67 namespace WebCore { |
| 68 const WrapperTypeInfo V8TestSpecialOperationsNotEnumerable::wrapperTypeInfo = {
gin::kEmbedderBlink, V8TestSpecialOperationsNotEnumerable::domTemplate, V8TestSp
ecialOperationsNotEnumerable::derefObject, 0, 0, 0, V8TestSpecialOperationsNotEn
umerable::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype, false
}; | 68 const WrapperTypeInfo V8TestSpecialOperationsNotEnumerable::wrapperTypeInfo = {
gin::kEmbedderBlink, V8TestSpecialOperationsNotEnumerable::domTemplate, V8TestSp
ecialOperationsNotEnumerable::derefObject, 0, 0, 0, V8TestSpecialOperationsNotEn
umerable::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype, false
}; |
| 69 | 69 |
| 70 namespace TestSpecialOperationsNotEnumerableV8Internal { | 70 namespace TestSpecialOperationsNotEnumerableV8Internal { |
| 71 | 71 |
| 72 template <typename T> void V8_USE(T) { } | 72 template <typename T> void V8_USE(T) { } |
| 73 | 73 |
| 74 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) | 74 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) |
| 75 { | 75 { |
| 76 TestSpecialOperationsNotEnumerable* collection = V8TestSpecialOperationsNotE
numerable::toNative(info.Holder()); | 76 TestSpecialOperationsNotEnumerable* imp = V8TestSpecialOperationsNotEnumerab
le::toNative(info.Holder()); |
| 77 String element = collection->anonymousIndexedGetter(index); | 77 String result = imp->anonymousIndexedGetter(index); |
| 78 if (element.isNull()) | 78 if (result.isNull()) |
| 79 return; | 79 return; |
| 80 v8SetReturnValueString(info, element, info.GetIsolate()); | 80 v8SetReturnValueString(info, result, info.GetIsolate()); |
| 81 } | 81 } |
| 82 | 82 |
| 83 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall
backInfo<v8::Value>& info) | 83 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall
backInfo<v8::Value>& info) |
| 84 { | 84 { |
| 85 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); | 85 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); |
| 86 TestSpecialOperationsNotEnumerableV8Internal::indexedPropertyGetter(index, i
nfo); | 86 TestSpecialOperationsNotEnumerableV8Internal::indexedPropertyGetter(index, i
nfo); |
| 87 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 87 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 88 } | 88 } |
| 89 | 89 |
| 90 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa
llbackInfo<v8::Value>& info) | 90 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa
llbackInfo<v8::Value>& info) |
| 91 { | 91 { |
| 92 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) | 92 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) |
| 93 return; | 93 return; |
| 94 if (info.Holder()->HasRealNamedCallbackProperty(name)) | 94 if (info.Holder()->HasRealNamedCallbackProperty(name)) |
| 95 return; | 95 return; |
| 96 if (info.Holder()->HasRealNamedProperty(name)) | 96 if (info.Holder()->HasRealNamedProperty(name)) |
| 97 return; | 97 return; |
| 98 | 98 |
| 99 TestSpecialOperationsNotEnumerable* collection = V8TestSpecialOperationsNotE
numerable::toNative(info.Holder()); | 99 TestSpecialOperationsNotEnumerable* imp = V8TestSpecialOperationsNotEnumerab
le::toNative(info.Holder()); |
| 100 AtomicString propertyName = toCoreAtomicString(name); | 100 AtomicString propertyName = toCoreAtomicString(name); |
| 101 String element = collection->anonymousNamedGetter(propertyName); | 101 String result = imp->anonymousNamedGetter(propertyName); |
| 102 if (element.isNull()) | 102 if (result.isNull()) |
| 103 return; | 103 return; |
| 104 v8SetReturnValueString(info, element, info.GetIsolate()); | 104 v8SetReturnValueString(info, result, info.GetIsolate()); |
| 105 } | 105 } |
| 106 | 106 |
| 107 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr
opertyCallbackInfo<v8::Value>& info) | 107 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr
opertyCallbackInfo<v8::Value>& info) |
| 108 { | 108 { |
| 109 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 109 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
| 110 TestSpecialOperationsNotEnumerableV8Internal::namedPropertyGetter(name, info
); | 110 TestSpecialOperationsNotEnumerableV8Internal::namedPropertyGetter(name, info
); |
| 111 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 111 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 112 } | 112 } |
| 113 | 113 |
| 114 } // namespace TestSpecialOperationsNotEnumerableV8Internal | 114 } // namespace TestSpecialOperationsNotEnumerableV8Internal |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 fromInternalPointer(object)->deref(); | 178 fromInternalPointer(object)->deref(); |
| 179 } | 179 } |
| 180 | 180 |
| 181 template<> | 181 template<> |
| 182 v8::Handle<v8::Value> toV8NoInline(TestSpecialOperationsNotEnumerable* impl, v8:
:Handle<v8::Object> creationContext, v8::Isolate* isolate) | 182 v8::Handle<v8::Value> toV8NoInline(TestSpecialOperationsNotEnumerable* impl, v8:
:Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| 183 { | 183 { |
| 184 return toV8(impl, creationContext, isolate); | 184 return toV8(impl, creationContext, isolate); |
| 185 } | 185 } |
| 186 | 186 |
| 187 } // namespace WebCore | 187 } // namespace WebCore |
| OLD | NEW |