| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Ericsson AB. All rights reserved. | 3 * Copyright (C) 2012 Ericsson AB. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 exceptionState.rethrowV8Exception(block.Exception()); | 723 exceptionState.rethrowV8Exception(block.Exception()); |
| 724 return Vector<T>(); | 724 return Vector<T>(); |
| 725 } | 725 } |
| 726 result.uncheckedAppend(TraitsType::nativeValue(element, isolate, excepti
onState)); | 726 result.uncheckedAppend(TraitsType::nativeValue(element, isolate, excepti
onState)); |
| 727 if (exceptionState.hadException()) | 727 if (exceptionState.hadException()) |
| 728 return Vector<T>(); | 728 return Vector<T>(); |
| 729 } | 729 } |
| 730 return result; | 730 return result; |
| 731 } | 731 } |
| 732 | 732 |
| 733 template <typename T> |
| 734 Vector<T> toImplArray(const Vector<ScriptValue>& value, v8::Isolate* isolate, Ex
ceptionState& exceptionState) |
| 735 { |
| 736 Vector<T> result; |
| 737 result.reserveInitialCapacity(value.size()); |
| 738 for (unsigned i = 0; i < value.size(); ++i) { |
| 739 result.uncheckedAppend(NativeValueTraits<T>::nativeValue(value[i].v8Valu
e(), isolate, exceptionState)); |
| 740 if (exceptionState.hadException()) |
| 741 return Vector<T>(); |
| 742 } |
| 743 return result; |
| 744 } |
| 745 |
| 733 template <class T> | 746 template <class T> |
| 734 Vector<T> toImplArguments(const v8::FunctionCallbackInfo<v8::Value>& info, int s
tartIndex, ExceptionState& exceptionState) | 747 Vector<T> toImplArguments(const v8::FunctionCallbackInfo<v8::Value>& info, int s
tartIndex, ExceptionState& exceptionState) |
| 735 { | 748 { |
| 736 Vector<T> result; | 749 Vector<T> result; |
| 737 typedef NativeValueTraits<T> TraitsType; | 750 typedef NativeValueTraits<T> TraitsType; |
| 738 int length = info.Length(); | 751 int length = info.Length(); |
| 739 if (startIndex < length) { | 752 if (startIndex < length) { |
| 740 result.reserveInitialCapacity(length - startIndex); | 753 result.reserveInitialCapacity(length - startIndex); |
| 741 for (int i = startIndex; i < length; ++i) { | 754 for (int i = startIndex; i < length; ++i) { |
| 742 result.uncheckedAppend(TraitsType::nativeValue(info[i], info.GetIsol
ate(), exceptionState)); | 755 result.uncheckedAppend(TraitsType::nativeValue(info[i], info.GetIsol
ate(), exceptionState)); |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1010 | 1023 |
| 1011 // Callback functions used by generated code. | 1024 // Callback functions used by generated code. |
| 1012 void v8ConstructorAttributeGetterAsProperty(v8::Local<v8::String> propertyName,
const v8::PropertyCallbackInfo<v8::Value>&); | 1025 void v8ConstructorAttributeGetterAsProperty(v8::Local<v8::String> propertyName,
const v8::PropertyCallbackInfo<v8::Value>&); |
| 1013 void v8ConstructorAttributeGetterAsAccessor(const v8::FunctionCallbackInfo<v8::V
alue>&); | 1026 void v8ConstructorAttributeGetterAsAccessor(const v8::FunctionCallbackInfo<v8::V
alue>&); |
| 1014 | 1027 |
| 1015 typedef void (*InstallTemplateFunction)(v8::Local<v8::FunctionTemplate>, v8::Iso
late*); | 1028 typedef void (*InstallTemplateFunction)(v8::Local<v8::FunctionTemplate>, v8::Iso
late*); |
| 1016 | 1029 |
| 1017 } // namespace blink | 1030 } // namespace blink |
| 1018 | 1031 |
| 1019 #endif // V8Binding_h | 1032 #endif // V8Binding_h |
| OLD | NEW |