| 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 { | 161 { |
| 162 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 162 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
| 163 TestSpecialOperationsAnonymousV8Internal::namedPropertySetter(name, jsValue,
info); | 163 TestSpecialOperationsAnonymousV8Internal::namedPropertySetter(name, jsValue,
info); |
| 164 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 164 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 165 } | 165 } |
| 166 | 166 |
| 167 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCal
lbackInfo<v8::Integer>& info) | 167 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCal
lbackInfo<v8::Integer>& info) |
| 168 { | 168 { |
| 169 TestSpecialOperationsAnonymous* imp = V8TestSpecialOperationsAnonymous::toNa
tive(info.Holder()); | 169 TestSpecialOperationsAnonymous* imp = V8TestSpecialOperationsAnonymous::toNa
tive(info.Holder()); |
| 170 AtomicString propertyName = toCoreAtomicString(name); | 170 AtomicString propertyName = toCoreAtomicString(name); |
| 171 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | 171 v8::String::Utf8Value namedProperty(name); |
| 172 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty,
"TestSpecialOperationsAnonymous", info.Holder(), info.GetIsolate()); |
| 172 bool result = imp->namedPropertyQuery(propertyName, exceptionState); | 173 bool result = imp->namedPropertyQuery(propertyName, exceptionState); |
| 173 if (exceptionState.throwIfNeeded()) | 174 if (exceptionState.throwIfNeeded()) |
| 174 return; | 175 return; |
| 175 if (!result) | 176 if (!result) |
| 176 return; | 177 return; |
| 177 v8SetReturnValueInt(info, v8::None); | 178 v8SetReturnValueInt(info, v8::None); |
| 178 } | 179 } |
| 179 | 180 |
| 180 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::Pro
pertyCallbackInfo<v8::Integer>& info) | 181 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::Pro
pertyCallbackInfo<v8::Integer>& info) |
| 181 { | 182 { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 197 { | 198 { |
| 198 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 199 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
| 199 TestSpecialOperationsAnonymousV8Internal::namedPropertyDeleter(name, info); | 200 TestSpecialOperationsAnonymousV8Internal::namedPropertyDeleter(name, info); |
| 200 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 201 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 201 } | 202 } |
| 202 | 203 |
| 203 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i
nfo) | 204 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i
nfo) |
| 204 { | 205 { |
| 205 TestSpecialOperationsAnonymous* imp = V8TestSpecialOperationsAnonymous::toNa
tive(info.Holder()); | 206 TestSpecialOperationsAnonymous* imp = V8TestSpecialOperationsAnonymous::toNa
tive(info.Holder()); |
| 206 Vector<String> names; | 207 Vector<String> names; |
| 207 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | 208 ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestSpeci
alOperationsAnonymous", info.Holder(), info.GetIsolate()); |
| 208 imp->namedPropertyEnumerator(names, exceptionState); | 209 imp->namedPropertyEnumerator(names, exceptionState); |
| 209 if (exceptionState.throwIfNeeded()) | 210 if (exceptionState.throwIfNeeded()) |
| 210 return; | 211 return; |
| 211 v8::Handle<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size
()); | 212 v8::Handle<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size
()); |
| 212 for (size_t i = 0; i < names.size(); ++i) | 213 for (size_t i = 0; i < names.size(); ++i) |
| 213 v8names->Set(v8::Integer::New(info.GetIsolate(), i), v8String(info.GetIs
olate(), names[i])); | 214 v8names->Set(v8::Integer::New(info.GetIsolate(), i), v8String(info.GetIs
olate(), names[i])); |
| 214 v8SetReturnValue(info, v8names); | 215 v8SetReturnValue(info, v8names); |
| 215 } | 216 } |
| 216 | 217 |
| 217 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A
rray>& info) | 218 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A
rray>& info) |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 fromInternalPointer(object)->deref(); | 294 fromInternalPointer(object)->deref(); |
| 294 } | 295 } |
| 295 | 296 |
| 296 template<> | 297 template<> |
| 297 v8::Handle<v8::Value> toV8NoInline(TestSpecialOperationsAnonymous* impl, v8::Han
dle<v8::Object> creationContext, v8::Isolate* isolate) | 298 v8::Handle<v8::Value> toV8NoInline(TestSpecialOperationsAnonymous* impl, v8::Han
dle<v8::Object> creationContext, v8::Isolate* isolate) |
| 298 { | 299 { |
| 299 return toV8(impl, creationContext, isolate); | 300 return toV8(impl, creationContext, isolate); |
| 300 } | 301 } |
| 301 | 302 |
| 302 } // namespace WebCore | 303 } // namespace WebCore |
| OLD | NEW |