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

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

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 7cad8c0ebcc8fdc6a4bc7fe0a288ecb33bec7b93..8d2926ce930d9dcbce7a5d8c20870bee3e06a5d1 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
+++ b/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
@@ -602,7 +602,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&);
@@ -664,7 +664,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;
@@ -673,10 +673,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);
@@ -684,21 +684,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;
@@ -707,40 +707,6 @@ 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)
-{
- v8::Local<v8::Value> v8Value(v8::Local<v8::Value>::New(isolate, value));
- uint32_t length = 0;
- if (value->IsArray()) {
- length = v8::Local<v8::Array>::Cast(v8Value)->Length();
- } else if (!toV8Sequence(value, length, isolate, exceptionState)) {
- if (!exceptionState.hadException())
- exceptionState.throwTypeError(ExceptionMessages::notAnArrayTypeArgumentOrValue(argumentIndex));
return HeapVector<Member<T>>();
}

Powered by Google App Engine
This is Rietveld 408576698