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

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

Issue 1853743005: Oilpan: Remove WillBe types (part 13) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
Index: third_party/WebKit/Source/bindings/core/v8/V8Binding.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Binding.h b/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
index d76ce351919b3f8fc934c53f0bc51fa12cbc5a8d..10b13dcea08e641fa6f5a1333cc7c9c23cdd95bc 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
+++ b/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
@@ -592,7 +592,7 @@ inline v8::MaybeLocal<v8::Value> v8DateOrNaN(v8::Isolate* isolate, double value)
}
// FIXME: Remove the special casing for NodeFilter and XPathNSResolver.
-PassRefPtrWillBeRawPtr<NodeFilter> toNodeFilter(v8::Local<v8::Value>, v8::Local<v8::Object>, ScriptState*);
+RawPtr<NodeFilter> toNodeFilter(v8::Local<v8::Value>, v8::Local<v8::Object>, ScriptState*);
XPathNSResolver* toXPathNSResolver(ScriptState*, v8::Local<v8::Value>);
bool toV8Sequence(v8::Local<v8::Value>, uint32_t& length, v8::Isolate*, ExceptionState&);
@@ -654,7 +654,7 @@ Vector<RefPtr<T>> toRefPtrNativeArray(v8::Local<v8::Value> value, const String&
}
template <typename T, typename V8T>
-WillBeHeapVector<RefPtrWillBeMember<T>> toRefPtrWillBeMemberNativeArray(v8::Local<v8::Value> value, int argumentIndex, v8::Isolate* isolate, ExceptionState& exceptionState)
+HeapVector<Member<T>> toMemberNativeArray(v8::Local<v8::Value> value, int argumentIndex, v8::Isolate* isolate, ExceptionState& exceptionState)
{
v8::Local<v8::Value> v8Value(v8::Local<v8::Value>::New(isolate, value));
uint32_t length = 0;
@@ -663,10 +663,10 @@ WillBeHeapVector<RefPtrWillBeMember<T>> toRefPtrWillBeMemberNativeArray(v8::Loca
} else if (!toV8Sequence(value, length, isolate, exceptionState)) {
if (!exceptionState.hadException())
exceptionState.throwTypeError(ExceptionMessages::notAnArrayTypeArgumentOrValue(argumentIndex));
- return WillBeHeapVector<RefPtrWillBeMember<T>>();
+ return HeapVector<Member<T>>();
}
- WillBeHeapVector<RefPtrWillBeMember<T>> result;
+ HeapVector<Member<T>> result;
result.reserveInitialCapacity(length);
v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(v8Value);
v8::TryCatch block(isolate);
@@ -674,21 +674,21 @@ WillBeHeapVector<RefPtrWillBeMember<T>> toRefPtrWillBeMemberNativeArray(v8::Loca
v8::Local<v8::Value> element;
if (!v8Call(object->Get(isolate->GetCurrentContext(), i), element, block)) {
exceptionState.rethrowV8Exception(block.Exception());
- return WillBeHeapVector<RefPtrWillBeMember<T>>();
+ return HeapVector<Member<T>>();
}
if (V8T::hasInstance(element, isolate)) {
v8::Local<v8::Object> elementObject = v8::Local<v8::Object>::Cast(element);
result.uncheckedAppend(V8T::toImpl(elementObject));
} else {
exceptionState.throwTypeError("Invalid Array element type");
- return WillBeHeapVector<RefPtrWillBeMember<T>>();
+ return HeapVector<Member<T>>();
}
}
return result;
}
template <typename T, typename V8T>
-WillBeHeapVector<RefPtrWillBeMember<T>> toRefPtrWillBeMemberNativeArray(v8::Local<v8::Value> value, const String& propertyName, v8::Isolate* isolate, ExceptionState& exceptionState)
+HeapVector<Member<T>> toMemberNativeArray(v8::Local<v8::Value> value, const String& propertyName, v8::Isolate* isolate, ExceptionState& exceptionState)
{
v8::Local<v8::Value> v8Value(v8::Local<v8::Value>::New(isolate, value));
uint32_t length = 0;
@@ -697,45 +697,12 @@ WillBeHeapVector<RefPtrWillBeMember<T>> toRefPtrWillBeMemberNativeArray(v8::Loca
} else if (!toV8Sequence(value, length, isolate, exceptionState)) {
if (!exceptionState.hadException())
exceptionState.throwTypeError(ExceptionMessages::notASequenceTypeProperty(propertyName));
- return WillBeHeapVector<RefPtrWillBeMember<T>>();
- }
-
- WillBeHeapVector<RefPtrWillBeMember<T>> result;
- result.reserveInitialCapacity(length);
- v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(v8Value);
- v8::TryCatch block(isolate);
- for (uint32_t i = 0; i < length; ++i) {
- v8::Local<v8::Value> element;
- if (!v8Call(object->Get(isolate->GetCurrentContext(), i), element, block)) {
- exceptionState.rethrowV8Exception(block.Exception());
- return WillBeHeapVector<RefPtrWillBeMember<T>>();
- }
- if (V8T::hasInstance(element, isolate)) {
- v8::Local<v8::Object> elementObject = v8::Local<v8::Object>::Cast(element);
- result.uncheckedAppend(V8T::toImpl(elementObject));
- } else {
- exceptionState.throwTypeError("Invalid Array element type");
- return WillBeHeapVector<RefPtrWillBeMember<T>>();
- }
- }
- return result;
-}
-
-template <typename T, typename V8T>
-HeapVector<Member<T>> toMemberNativeArray(v8::Local<v8::Value> value, int argumentIndex, v8::Isolate* isolate, ExceptionState& exceptionState)
-{
- uint32_t length = 0;
- if (value->IsArray()) {
- length = v8::Local<v8::Array>::Cast(value)->Length();
- } else if (!toV8Sequence(value, length, isolate, exceptionState)) {
- if (!exceptionState.hadException())
- exceptionState.throwTypeError(ExceptionMessages::notAnArrayTypeArgumentOrValue(argumentIndex));
return HeapVector<Member<T>>();
}
HeapVector<Member<T>> result;
result.reserveInitialCapacity(length);
- v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(value);
+ v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(v8Value);
v8::TryCatch block(isolate);
for (uint32_t i = 0; i < length; ++i) {
v8::Local<v8::Value> element;

Powered by Google App Engine
This is Rietveld 408576698