Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Unified Diff: Source/bindings/core/v8/V8Binding.h

Issue 1150863004: toImplArguments should return HeapVector for Union types. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/bindings/scripts/v8_methods.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/V8Binding.h
diff --git a/Source/bindings/core/v8/V8Binding.h b/Source/bindings/core/v8/V8Binding.h
index e6326f405052770dd3f4676d6be900cf3aa858c6..1e3c867b3c3c7134403e27a891b05342e497cfb9 100644
--- a/Source/bindings/core/v8/V8Binding.h
+++ b/Source/bindings/core/v8/V8Binding.h
@@ -804,18 +804,19 @@ VectorType toImplArray(const Vector<ScriptValue>& value, v8::Isolate* isolate, E
return result;
}
-template <typename T>
-Vector<T> toImplArguments(const v8::FunctionCallbackInfo<v8::Value>& info, int startIndex, ExceptionState& exceptionState)
+template <typename VectorType>
+VectorType toImplArguments(const v8::FunctionCallbackInfo<v8::Value>& info, int startIndex, ExceptionState& exceptionState)
{
- Vector<T> result;
- typedef NativeValueTraits<T> TraitsType;
+ VectorType result;
+ typedef typename VectorType::ValueType ValueType;
+ typedef NativeValueTraits<ValueType> TraitsType;
int length = info.Length();
if (startIndex < length) {
result.reserveInitialCapacity(length - startIndex);
for (int i = startIndex; i < length; ++i) {
result.uncheckedAppend(TraitsType::nativeValue(info.GetIsolate(), info[i], exceptionState));
if (exceptionState.hadException())
- return Vector<T>();
+ return VectorType();
}
}
return result;
« no previous file with comments | « no previous file | Source/bindings/scripts/v8_methods.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698