Use Span for IPC::ArrayReference and DataReference
Created attachment 446181 [details] Patch
Created attachment 446195 [details] Patch
Comment on attachment 446195 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=446195&action=review > Source/WTF/wtf/Vector.h:657 > + Vector(Span<const T> span) Would it be better to take a `const Span<const T>&` instead? > Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:1643 > + if (pdfData.empty()) { It does seem a bit odd that while Span uses `bool empty()`, all other WTF classes use `bool isEmpty()`. Maybe we should rename this for consistency at some point..
(In reply to Wenson Hsieh from comment #3) > Comment on attachment 446195 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=446195&action=review > > > Source/WTF/wtf/Vector.h:657 > > + Vector(Span<const T> span) > > Would it be better to take a `const Span<const T>&` instead? No, a Span is two registers so passed by value, like a StringView, and this is inline anyways. > > > Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:1643 > > + if (pdfData.empty()) { > > It does seem a bit odd that while Span uses `bool empty()`, all other WTF > classes use `bool isEmpty()`. Maybe we should rename this for consistency at > some point.. WTF::Span is an implementation of std::span, which we'll switch to after turning on C++20. std::span::empty exists but std::span::isEmpty does not.
r286815