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 5002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5013 { | 5013 { |
5014 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) | 5014 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) |
5015 return; | 5015 return; |
5016 if (info.Holder()->HasRealNamedCallbackProperty(name)) | 5016 if (info.Holder()->HasRealNamedCallbackProperty(name)) |
5017 return; | 5017 return; |
5018 if (info.Holder()->HasRealNamedProperty(name)) | 5018 if (info.Holder()->HasRealNamedProperty(name)) |
5019 return; | 5019 return; |
5020 | 5020 |
5021 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder())); | 5021 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder())); |
5022 TestObj* collection = V8TestObject::toNative(info.Holder()); | 5022 TestObj* collection = V8TestObject::toNative(info.Holder()); |
5023 AtomicString propertyName = toWebCoreAtomicString(name); | 5023 AtomicString propertyName = toCoreAtomicString(name); |
5024 String element = collection->namedItem(propertyName); | 5024 String element = collection->namedItem(propertyName); |
5025 if (element.isNull()) | 5025 if (element.isNull()) |
5026 return; | 5026 return; |
5027 v8SetReturnValueString(info, element, info.GetIsolate()); | 5027 v8SetReturnValueString(info, element, info.GetIsolate()); |
5028 } | 5028 } |
5029 | 5029 |
5030 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr
opertyCallbackInfo<v8::Value>& info) | 5030 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr
opertyCallbackInfo<v8::Value>& info) |
5031 { | 5031 { |
5032 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 5032 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
5033 TestObjV8Internal::namedPropertyGetter(name, info); | 5033 TestObjV8Internal::namedPropertyGetter(name, info); |
(...skipping 10 matching lines...) Expand all Loading... |
5044 return; | 5044 return; |
5045 v8::Handle<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size
()); | 5045 v8::Handle<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size
()); |
5046 for (size_t i = 0; i < names.size(); ++i) | 5046 for (size_t i = 0; i < names.size(); ++i) |
5047 v8names->Set(v8::Integer::New(info.GetIsolate(), i), v8String(info.GetIs
olate(), names[i])); | 5047 v8names->Set(v8::Integer::New(info.GetIsolate(), i), v8String(info.GetIs
olate(), names[i])); |
5048 v8SetReturnValue(info, v8names); | 5048 v8SetReturnValue(info, v8names); |
5049 } | 5049 } |
5050 | 5050 |
5051 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCal
lbackInfo<v8::Integer>& info) | 5051 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCal
lbackInfo<v8::Integer>& info) |
5052 { | 5052 { |
5053 TestObj* collection = V8TestObject::toNative(info.Holder()); | 5053 TestObj* collection = V8TestObject::toNative(info.Holder()); |
5054 AtomicString propertyName = toWebCoreAtomicString(name); | 5054 AtomicString propertyName = toCoreAtomicString(name); |
5055 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | 5055 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); |
5056 bool result = collection->namedPropertyQuery(propertyName, exceptionState); | 5056 bool result = collection->namedPropertyQuery(propertyName, exceptionState); |
5057 if (exceptionState.throwIfNeeded()) | 5057 if (exceptionState.throwIfNeeded()) |
5058 return; | 5058 return; |
5059 if (!result) | 5059 if (!result) |
5060 return; | 5060 return; |
5061 v8SetReturnValueInt(info, v8::None); | 5061 v8SetReturnValueInt(info, v8::None); |
5062 } | 5062 } |
5063 | 5063 |
5064 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A
rray>& info) | 5064 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A
rray>& info) |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5435 fromInternalPointer(object)->deref(); | 5435 fromInternalPointer(object)->deref(); |
5436 } | 5436 } |
5437 | 5437 |
5438 template<> | 5438 template<> |
5439 v8::Handle<v8::Value> toV8NoInline(TestObj* impl, v8::Handle<v8::Object> creatio
nContext, v8::Isolate* isolate) | 5439 v8::Handle<v8::Value> toV8NoInline(TestObj* impl, v8::Handle<v8::Object> creatio
nContext, v8::Isolate* isolate) |
5440 { | 5440 { |
5441 return toV8(impl, creationContext, isolate); | 5441 return toV8(impl, creationContext, isolate); |
5442 } | 5442 } |
5443 | 5443 |
5444 } // namespace WebCore | 5444 } // namespace WebCore |
OLD | NEW |