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 5193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5204 static void deprecatedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) | 5204 static void deprecatedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) |
5205 { | 5205 { |
5206 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 5206 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
5207 UseCounter::countDeprecation(activeExecutionContext(info.GetIsolate()), UseC
ounter::StaticMethod); | 5207 UseCounter::countDeprecation(activeExecutionContext(info.GetIsolate()), UseC
ounter::StaticMethod); |
5208 TestObjV8Internal::deprecatedStaticMethodMethod(info); | 5208 TestObjV8Internal::deprecatedStaticMethodMethod(info); |
5209 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 5209 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
5210 } | 5210 } |
5211 | 5211 |
5212 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) | 5212 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) |
5213 { | 5213 { |
5214 TestObj* collection = V8TestObject::toNative(info.Holder()); | 5214 TestObj* imp = V8TestObject::toNative(info.Holder()); |
5215 RefPtr<Node> element = collection->anonymousIndexedGetter(index); | 5215 RefPtr<Node> result = imp->anonymousIndexedGetter(index); |
5216 if (!element) | 5216 if (!result) |
5217 return; | 5217 return; |
5218 v8SetReturnValueFast(info, element.release(), collection); | 5218 v8SetReturnValueFast(info, result.release(), imp); |
5219 } | 5219 } |
5220 | 5220 |
5221 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall
backInfo<v8::Value>& info) | 5221 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall
backInfo<v8::Value>& info) |
5222 { | 5222 { |
5223 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); | 5223 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); |
5224 TestObjV8Internal::indexedPropertyGetter(index, info); | 5224 TestObjV8Internal::indexedPropertyGetter(index, info); |
5225 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 5225 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
5226 } | 5226 } |
5227 | 5227 |
5228 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa
llbackInfo<v8::Value>& info) | 5228 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa
llbackInfo<v8::Value>& info) |
5229 { | 5229 { |
5230 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) | 5230 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) |
5231 return; | 5231 return; |
5232 if (info.Holder()->HasRealNamedCallbackProperty(name)) | 5232 if (info.Holder()->HasRealNamedCallbackProperty(name)) |
5233 return; | 5233 return; |
5234 if (info.Holder()->HasRealNamedProperty(name)) | 5234 if (info.Holder()->HasRealNamedProperty(name)) |
5235 return; | 5235 return; |
5236 | 5236 |
5237 TestObj* collection = V8TestObject::toNative(info.Holder()); | 5237 TestObj* imp = V8TestObject::toNative(info.Holder()); |
5238 AtomicString propertyName = toCoreAtomicString(name); | 5238 AtomicString propertyName = toCoreAtomicString(name); |
5239 String element = collection->anonymousNamedGetter(propertyName); | 5239 String result = imp->anonymousNamedGetter(propertyName); |
5240 if (element.isNull()) | 5240 if (result.isNull()) |
5241 return; | 5241 return; |
5242 v8SetReturnValueString(info, element, info.GetIsolate()); | 5242 v8SetReturnValueString(info, result, info.GetIsolate()); |
5243 } | 5243 } |
5244 | 5244 |
5245 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr
opertyCallbackInfo<v8::Value>& info) | 5245 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr
opertyCallbackInfo<v8::Value>& info) |
5246 { | 5246 { |
5247 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 5247 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
5248 TestObjV8Internal::namedPropertyGetter(name, info); | 5248 TestObjV8Internal::namedPropertyGetter(name, info); |
5249 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 5249 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
5250 } | 5250 } |
5251 | 5251 |
5252 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCal
lbackInfo<v8::Integer>& info) | 5252 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCal
lbackInfo<v8::Integer>& info) |
5253 { | 5253 { |
5254 TestObj* collection = V8TestObject::toNative(info.Holder()); | 5254 TestObj* imp = V8TestObject::toNative(info.Holder()); |
5255 AtomicString propertyName = toCoreAtomicString(name); | 5255 AtomicString propertyName = toCoreAtomicString(name); |
5256 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | 5256 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); |
5257 bool result = collection->namedPropertyQuery(propertyName, exceptionState); | 5257 bool result = imp->namedPropertyQuery(propertyName, exceptionState); |
5258 if (exceptionState.throwIfNeeded()) | 5258 if (exceptionState.throwIfNeeded()) |
5259 return; | 5259 return; |
5260 if (!result) | 5260 if (!result) |
5261 return; | 5261 return; |
5262 v8SetReturnValueInt(info, v8::None); | 5262 v8SetReturnValueInt(info, v8::None); |
5263 } | 5263 } |
5264 | 5264 |
5265 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::Pro
pertyCallbackInfo<v8::Integer>& info) | 5265 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::Pro
pertyCallbackInfo<v8::Integer>& info) |
5266 { | 5266 { |
5267 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 5267 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
5268 TestObjV8Internal::namedPropertyQuery(name, info); | 5268 TestObjV8Internal::namedPropertyQuery(name, info); |
5269 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 5269 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
5270 } | 5270 } |
5271 | 5271 |
5272 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i
nfo) | 5272 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i
nfo) |
5273 { | 5273 { |
5274 TestObj* collection = V8TestObject::toNative(info.Holder()); | 5274 TestObj* imp = V8TestObject::toNative(info.Holder()); |
5275 Vector<String> names; | 5275 Vector<String> names; |
5276 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | 5276 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); |
5277 collection->namedPropertyEnumerator(names, exceptionState); | 5277 imp->namedPropertyEnumerator(names, exceptionState); |
5278 if (exceptionState.throwIfNeeded()) | 5278 if (exceptionState.throwIfNeeded()) |
5279 return; | 5279 return; |
5280 v8::Handle<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size
()); | 5280 v8::Handle<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size
()); |
5281 for (size_t i = 0; i < names.size(); ++i) | 5281 for (size_t i = 0; i < names.size(); ++i) |
5282 v8names->Set(v8::Integer::New(info.GetIsolate(), i), v8String(info.GetIs
olate(), names[i])); | 5282 v8names->Set(v8::Integer::New(info.GetIsolate(), i), v8String(info.GetIs
olate(), names[i])); |
5283 v8SetReturnValue(info, v8names); | 5283 v8SetReturnValue(info, v8names); |
5284 } | 5284 } |
5285 | 5285 |
5286 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A
rray>& info) | 5286 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A
rray>& info) |
5287 { | 5287 { |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5604 fromInternalPointer(object)->deref(); | 5604 fromInternalPointer(object)->deref(); |
5605 } | 5605 } |
5606 | 5606 |
5607 template<> | 5607 template<> |
5608 v8::Handle<v8::Value> toV8NoInline(TestObj* impl, v8::Handle<v8::Object> creatio
nContext, v8::Isolate* isolate) | 5608 v8::Handle<v8::Value> toV8NoInline(TestObj* impl, v8::Handle<v8::Object> creatio
nContext, v8::Isolate* isolate) |
5609 { | 5609 { |
5610 return toV8(impl, creationContext, isolate); | 5610 return toV8(impl, creationContext, isolate); |
5611 } | 5611 } |
5612 | 5612 |
5613 } // namespace WebCore | 5613 } // namespace WebCore |
OLD | NEW |