Chromium Code Reviews| 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)); | |
|
bashi
2015/03/06 15:53:15
You need to check whether the exceptionState had a
| |
| 740 return result; | |
| 741 } | |
| 742 | |
| 733 template <class T> | 743 template <class T> |
| 734 Vector<T> toImplArguments(const v8::FunctionCallbackInfo<v8::Value>& info, int s tartIndex, ExceptionState& exceptionState) | 744 Vector<T> toImplArguments(const v8::FunctionCallbackInfo<v8::Value>& info, int s tartIndex, ExceptionState& exceptionState) |
| 735 { | 745 { |
| 736 Vector<T> result; | 746 Vector<T> result; |
| 737 typedef NativeValueTraits<T> TraitsType; | 747 typedef NativeValueTraits<T> TraitsType; |
| 738 int length = info.Length(); | 748 int length = info.Length(); |
| 739 if (startIndex < length) { | 749 if (startIndex < length) { |
| 740 result.reserveInitialCapacity(length - startIndex); | 750 result.reserveInitialCapacity(length - startIndex); |
| 741 for (int i = startIndex; i < length; ++i) { | 751 for (int i = startIndex; i < length; ++i) { |
| 742 result.uncheckedAppend(TraitsType::nativeValue(info[i], info.GetIsol ate(), exceptionState)); | 752 result.uncheckedAppend(TraitsType::nativeValue(info[i], info.GetIsol ate(), exceptionState)); |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1010 | 1020 |
| 1011 // Callback functions used by generated code. | 1021 // Callback functions used by generated code. |
| 1012 void v8ConstructorAttributeGetterAsProperty(v8::Local<v8::String> propertyName, const v8::PropertyCallbackInfo<v8::Value>&); | 1022 void v8ConstructorAttributeGetterAsProperty(v8::Local<v8::String> propertyName, const v8::PropertyCallbackInfo<v8::Value>&); |
| 1013 void v8ConstructorAttributeGetterAsAccessor(const v8::FunctionCallbackInfo<v8::V alue>&); | 1023 void v8ConstructorAttributeGetterAsAccessor(const v8::FunctionCallbackInfo<v8::V alue>&); |
| 1014 | 1024 |
| 1015 typedef void (*InstallTemplateFunction)(v8::Local<v8::FunctionTemplate>, v8::Iso late*); | 1025 typedef void (*InstallTemplateFunction)(v8::Local<v8::FunctionTemplate>, v8::Iso late*); |
| 1016 | 1026 |
| 1017 } // namespace blink | 1027 } // namespace blink |
| 1018 | 1028 |
| 1019 #endif // V8Binding_h | 1029 #endif // V8Binding_h |
| OLD | NEW |