PerformanceEntryList should be iterable as per the current spec: https://www.w3.org/TR/2016/WD-performance-timeline-2-20160421/#idl-def-performanceentrylist.
Created attachment 286385 [details] Patch
Comment on attachment 286385 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=286385&action=review > Source/WebCore/page/Performance.cpp:92 > -RefPtr<PerformanceEntryList> Performance::getEntries() const > +Vector<RefPtr<PerformanceEntry>> Performance::getEntries() const Could these be Ref<PerformanceEntry>s? > Source/WebCore/page/Performance.cpp:105 > + std::sort(entries.begin(), entries.end(), PerformanceEntry::startTimeCompareLessThan); do we have to sort everything?
Comment on attachment 286385 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=286385&action=review > LayoutTests/http/tests/performance/performance-resource-timing-entries-iterable-expected.txt:1 > +PASS resources is an instance of Array Would be nice if this test had a description. > LayoutTests/http/tests/performance/performance-resource-timing-entries-iterable.html:3 > +<script> description("....");
Comment on attachment 286385 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=286385&action=review > Source/WebCore/page/Performance.h:67 > + Vector<RefPtr<PerformanceEntry>> getEntriesByType(const String& entryType); Why is this not const? > Source/WebCore/page/Performance.h:68 > + Vector<RefPtr<PerformanceEntry>> getEntriesByName(const String& name, const String& entryType); Why is this not const?
(In reply to comment #2) > > Source/WebCore/page/Performance.cpp:92 > > -RefPtr<PerformanceEntryList> Performance::getEntries() const > > +Vector<RefPtr<PerformanceEntry>> Performance::getEntries() const > > Could these be Ref<PerformanceEntry>s? Some of the User Timing code uses PassRefPtr, so it should probably be updated in another patch. > > > Source/WebCore/page/Performance.cpp:105 > > + std::sort(entries.begin(), entries.end(), PerformanceEntry::startTimeCompareLessThan); > > do we have to sort everything? Yes, per the spec we should sort them by start time. Entries gets added according to responseEnd. (In reply to comment #3) > > LayoutTests/http/tests/performance/performance-resource-timing-entries-iterable-expected.txt:1 > > +PASS resources is an instance of Array > > Would be nice if this test had a description. Ah, yeah. (In reply to comment #4) > > Source/WebCore/page/Performance.h:67 > > + Vector<RefPtr<PerformanceEntry>> getEntriesByType(const String& entryType); > > Why is this not const? Hm... Don’t see any reason why it isn’t.
Created attachment 286406 [details] Patch
Comment on attachment 286406 [details] Patch lgtm
Comment on attachment 286406 [details] Patch Clearing flags on attachment: 286406 Committed r204641: <http://trac.webkit.org/changeset/204641>
All reviewed patches have been landed. Closing bug.