Diff
Modified: trunk/LayoutTests/ChangeLog (204640 => 204641)
--- trunk/LayoutTests/ChangeLog 2016-08-19 18:24:50 UTC (rev 204640)
+++ trunk/LayoutTests/ChangeLog 2016-08-19 18:30:10 UTC (rev 204641)
@@ -1,3 +1,15 @@
+2016-08-19 Johan K. Jensen <[email protected]>
+
+ Resource Timing: Make PerformanceEntryList a sequence as per spec
+ https://bugs.webkit.org/show_bug.cgi?id=160963
+
+ Reviewed by Alex Christensen.
+
+ Testing that PerformanceEntryList (window.performance.getEntries()) is iterable.
+
+ * http/tests/performance/performance-resource-timing-entries-iterable-expected.txt: Added.
+ * http/tests/performance/performance-resource-timing-entries-iterable.html: Added.
+
2016-08-19 Ryan Haddad <[email protected]>
Unskip tests that now pass on ios-simulator.
Added: trunk/LayoutTests/http/tests/performance/performance-resource-timing-entries-iterable-expected.txt (0 => 204641)
--- trunk/LayoutTests/http/tests/performance/performance-resource-timing-entries-iterable-expected.txt (rev 0)
+++ trunk/LayoutTests/http/tests/performance/performance-resource-timing-entries-iterable-expected.txt 2016-08-19 18:30:10 UTC (rev 204641)
@@ -0,0 +1,14 @@
+Test that PerformanceEntryList (window.performance.getEntries()) is iterable.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS resources is an instance of Array
+PASS resources.length is defined.
+PASS resources.length is 1
+PASS resources[0] is defined.
+PASS entryTypes[0] is "resource"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/http/tests/performance/performance-resource-timing-entries-iterable.html (0 => 204641)
--- trunk/LayoutTests/http/tests/performance/performance-resource-timing-entries-iterable.html (rev 0)
+++ trunk/LayoutTests/http/tests/performance/performance-resource-timing-entries-iterable.html 2016-08-19 18:30:10 UTC (rev 204641)
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+<script>
+ if (window.internals)
+ internals.setResourceTimingSupport(true);
+ function resolve(path) {
+ var a = document.createElement("a");
+ a.href = ""
+ return a.href;
+ }
+ var url = "" + Math.random());
+ document.write("<img src=''>");
+</script>
+<script src=""
+<script>
+ window.jsTestIsAsync = true;
+
+ description("Test that PerformanceEntryList (window.performance.getEntries()) is iterable.");
+
+ var resources, entryType;
+ window.addEventListener("load", function() {
+ resources = performance.getEntriesByName(url);
+ shouldBeType("resources", "Array");
+ shouldBeDefined("resources.length");
+ shouldBe("resources.length", "1");
+ shouldBeDefined("resources[0]");
+ entryTypes = resources.map((entry) => entry.entryType);
+ shouldBeEqualToString("entryTypes[0]", "resource");
+ if (window.internals)
+ window.internals.setResourceTimingSupport(false);
+ finishJSTest();
+ });
+</script>
+<script src=""
+</body>
+</html>
Modified: trunk/Source/WebCore/CMakeLists.txt (204640 => 204641)
--- trunk/Source/WebCore/CMakeLists.txt 2016-08-19 18:24:50 UTC (rev 204640)
+++ trunk/Source/WebCore/CMakeLists.txt 2016-08-19 18:30:10 UTC (rev 204641)
@@ -622,7 +622,6 @@
page/NavigatorOnLine.idl
page/Performance.idl
page/PerformanceEntry.idl
- page/PerformanceEntryList.idl
page/PerformanceMark.idl
page/PerformanceMeasure.idl
page/PerformanceNavigation.idl
@@ -2064,7 +2063,6 @@
page/PageVisibilityState.cpp
page/Performance.cpp
page/PerformanceEntry.cpp
- page/PerformanceEntryList.cpp
page/PerformanceNavigation.cpp
page/PerformanceResourceTiming.cpp
page/PerformanceTiming.cpp
Modified: trunk/Source/WebCore/ChangeLog (204640 => 204641)
--- trunk/Source/WebCore/ChangeLog 2016-08-19 18:24:50 UTC (rev 204640)
+++ trunk/Source/WebCore/ChangeLog 2016-08-19 18:30:10 UTC (rev 204641)
@@ -1,3 +1,44 @@
+2016-08-19 Johan K. Jensen <[email protected]>
+
+ Resource Timing: Make PerformanceEntryList a sequence as per spec
+ https://bugs.webkit.org/show_bug.cgi?id=160963
+
+ Reviewed by Alex Christensen.
+
+ Change PerformanceEntryList to be a sequence of PerformanceEntry instead of an object.
+
+ Test: http/tests/performance/performance-resource-timing-entries-iterable.html
+
+ * CMakeLists.txt:
+ * DerivedSources.cpp:
+ * DerivedSources.make:
+ * PlatformGTK.cmake:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/scripts/CodeGeneratorGObject.pm:
+ Remove references to {JS,}PerformanceEntryList.{cpp,h,idl}.
+
+ * page/Performance.cpp:
+ (WebCore::Performance::getEntries):
+ (WebCore::Performance::getEntriesByType):
+ (WebCore::Performance::getEntriesByName):
+ * page/Performance.h:
+ Methods now operate on a Vector of PerformanceEntry.
+
+ * page/Performance.idl:
+ Typedef PerformanceEntryList as a sequence of PerformanceEntry.
+
+ * page/PerformanceEntryList.cpp: Removed.
+ (WebCore::PerformanceEntryList::PerformanceEntryList): Deleted.
+ (WebCore::PerformanceEntryList::~PerformanceEntryList): Deleted.
+ (WebCore::PerformanceEntryList::length): Deleted.
+ (WebCore::PerformanceEntryList::item): Deleted.
+ (WebCore::PerformanceEntryList::append): Deleted.
+ (WebCore::PerformanceEntryList::appendAll): Deleted.
+ (WebCore::PerformanceEntryList::sort): Deleted.
+ * page/PerformanceEntryList.h: Removed.
+ (WebCore::PerformanceEntryList::create): Deleted.
+ * page/PerformanceEntryList.idl: Removed.
+
2016-08-19 Eric Carlson <[email protected]>
[Mac] fix PiP context menu typos
Modified: trunk/Source/WebCore/DerivedSources.cpp (204640 => 204641)
--- trunk/Source/WebCore/DerivedSources.cpp 2016-08-19 18:24:50 UTC (rev 204640)
+++ trunk/Source/WebCore/DerivedSources.cpp 2016-08-19 18:30:10 UTC (rev 204641)
@@ -382,7 +382,6 @@
#include "JSParentNode.cpp"
#include "JSPerformance.cpp"
#include "JSPerformanceEntry.cpp"
-#include "JSPerformanceEntryList.cpp"
#include "JSPerformanceMark.cpp"
#include "JSPerformanceMeasure.cpp"
#include "JSPerformanceNavigation.cpp"
Modified: trunk/Source/WebCore/DerivedSources.make (204640 => 204641)
--- trunk/Source/WebCore/DerivedSources.make 2016-08-19 18:24:50 UTC (rev 204640)
+++ trunk/Source/WebCore/DerivedSources.make 2016-08-19 18:30:10 UTC (rev 204641)
@@ -527,7 +527,6 @@
$(WebCore)/page/NavigatorOnLine.idl \
$(WebCore)/page/Performance.idl \
$(WebCore)/page/PerformanceEntry.idl \
- $(WebCore)/page/PerformanceEntryList.idl \
$(WebCore)/page/PerformanceNavigation.idl \
$(WebCore)/page/PerformanceResourceTiming.idl \
$(WebCore)/page/PerformanceTiming.idl \
Modified: trunk/Source/WebCore/PlatformGTK.cmake (204640 => 204641)
--- trunk/Source/WebCore/PlatformGTK.cmake 2016-08-19 18:24:50 UTC (rev 204640)
+++ trunk/Source/WebCore/PlatformGTK.cmake 2016-08-19 18:30:10 UTC (rev 204641)
@@ -578,7 +578,6 @@
page/Navigator.idl
page/Performance.idl
page/PerformanceEntry.idl
- page/PerformanceEntryList.idl
page/PerformanceNavigation.idl
page/PerformanceTiming.idl
page/Screen.idl
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (204640 => 204641)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2016-08-19 18:24:50 UTC (rev 204640)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2016-08-19 18:30:10 UTC (rev 204641)
@@ -3382,8 +3382,6 @@
868160D618766A130021E79D /* UserActivity.h in Headers */ = {isa = PBXBuildFile; fileRef = 868160D2187669C40021E79D /* UserActivity.h */; settings = {ATTRIBUTES = (Private, ); }; };
86BA766E166427A8005BE5D1 /* FrameLoadRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86BA766D166427A8005BE5D1 /* FrameLoadRequest.cpp */; };
86BE340115058CB200CE0FD8 /* PerformanceEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 86BE33FB15058CB200CE0FD8 /* PerformanceEntry.h */; };
- 86BE340315058CB200CE0FD8 /* PerformanceEntryList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86BE33FD15058CB200CE0FD8 /* PerformanceEntryList.cpp */; };
- 86BE340415058CB200CE0FD8 /* PerformanceEntryList.h in Headers */ = {isa = PBXBuildFile; fileRef = 86BE33FE15058CB200CE0FD8 /* PerformanceEntryList.h */; };
86D982F7125C154000AD9E3D /* DocumentTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 86D982F6125C154000AD9E3D /* DocumentTiming.h */; settings = {ATTRIBUTES = (Private, ); }; };
8931DE5B14C44C44000DC9D2 /* JSBlobCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8931DE5A14C44C44000DC9D2 /* JSBlobCustom.cpp */; };
898785F0122E1E87003AABDA /* JSFileException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 898785EE122E1E87003AABDA /* JSFileException.cpp */; };
@@ -5886,8 +5884,6 @@
CB38FD4B1CCCF36600592A3F /* PerformanceEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CB38FD4A1CCCF2DD00592A3F /* PerformanceEntry.cpp */; };
CB38FD511CCF938900592A3F /* JSPerformanceEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CB38FD4D1CCF937E00592A3F /* JSPerformanceEntry.cpp */; };
CB38FD521CCF939400592A3F /* JSPerformanceEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = CB38FD4E1CCF937E00592A3F /* JSPerformanceEntry.h */; };
- CB38FD531CCF939B00592A3F /* JSPerformanceEntryList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CB38FD4F1CCF937E00592A3F /* JSPerformanceEntryList.cpp */; };
- CB38FD541CCF939E00592A3F /* JSPerformanceEntryList.h in Headers */ = {isa = PBXBuildFile; fileRef = CB38FD501CCF937E00592A3F /* JSPerformanceEntryList.h */; };
CB38FD571CD21E2A00592A3F /* JSPerformanceEntryCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CB38FD551CD21D5B00592A3F /* JSPerformanceEntryCustom.cpp */; };
CB38FD5A1CD2325800592A3F /* JSPerformanceResourceTiming.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CB38FD581CD2314500592A3F /* JSPerformanceResourceTiming.cpp */; };
CB38FD5B1CD2325B00592A3F /* JSPerformanceResourceTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = CB38FD591CD2314500592A3F /* JSPerformanceResourceTiming.h */; };
@@ -10882,9 +10878,6 @@
86BA766D166427A8005BE5D1 /* FrameLoadRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FrameLoadRequest.cpp; sourceTree = "<group>"; };
86BE33FB15058CB200CE0FD8 /* PerformanceEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceEntry.h; sourceTree = "<group>"; };
86BE33FC15058CB200CE0FD8 /* PerformanceEntry.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PerformanceEntry.idl; sourceTree = "<group>"; };
- 86BE33FD15058CB200CE0FD8 /* PerformanceEntryList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PerformanceEntryList.cpp; sourceTree = "<group>"; };
- 86BE33FE15058CB200CE0FD8 /* PerformanceEntryList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceEntryList.h; sourceTree = "<group>"; };
- 86BE33FF15058CB200CE0FD8 /* PerformanceEntryList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PerformanceEntryList.idl; sourceTree = "<group>"; };
86D982F6125C154000AD9E3D /* DocumentTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentTiming.h; sourceTree = "<group>"; };
892ABE5C16EEE2AA009F3587 /* JSNavigatorStorageQuota.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSNavigatorStorageQuota.cpp; sourceTree = "<group>"; };
892ABE5D16EEE2AA009F3587 /* JSNavigatorStorageQuota.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSNavigatorStorageQuota.h; sourceTree = "<group>"; };
@@ -13746,8 +13739,6 @@
CB38FD4A1CCCF2DD00592A3F /* PerformanceEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PerformanceEntry.cpp; sourceTree = "<group>"; };
CB38FD4D1CCF937E00592A3F /* JSPerformanceEntry.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = JSPerformanceEntry.cpp; sourceTree = "<group>"; };
CB38FD4E1CCF937E00592A3F /* JSPerformanceEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPerformanceEntry.h; sourceTree = "<group>"; };
- CB38FD4F1CCF937E00592A3F /* JSPerformanceEntryList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPerformanceEntryList.cpp; sourceTree = "<group>"; };
- CB38FD501CCF937E00592A3F /* JSPerformanceEntryList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = JSPerformanceEntryList.h; sourceTree = "<group>"; };
CB38FD551CD21D5B00592A3F /* JSPerformanceEntryCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPerformanceEntryCustom.cpp; sourceTree = "<group>"; };
CB38FD581CD2314500592A3F /* JSPerformanceResourceTiming.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPerformanceResourceTiming.cpp; sourceTree = "<group>"; };
CB38FD591CD2314500592A3F /* JSPerformanceResourceTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPerformanceResourceTiming.h; sourceTree = "<group>"; };
@@ -18293,9 +18284,6 @@
CB38FD4A1CCCF2DD00592A3F /* PerformanceEntry.cpp */,
86BE33FB15058CB200CE0FD8 /* PerformanceEntry.h */,
86BE33FC15058CB200CE0FD8 /* PerformanceEntry.idl */,
- 86BE33FD15058CB200CE0FD8 /* PerformanceEntryList.cpp */,
- 86BE33FE15058CB200CE0FD8 /* PerformanceEntryList.h */,
- 86BE33FF15058CB200CE0FD8 /* PerformanceEntryList.idl */,
8AF4E55211DC5A36000ED3DE /* PerformanceNavigation.cpp */,
8AF4E55311DC5A36000ED3DE /* PerformanceNavigation.h */,
8AF4E55411DC5A36000ED3DE /* PerformanceNavigation.idl */,
@@ -22391,8 +22379,6 @@
8A9A587311E84C81008ACFD1 /* JSPerformance.h */,
CB38FD4D1CCF937E00592A3F /* JSPerformanceEntry.cpp */,
CB38FD4E1CCF937E00592A3F /* JSPerformanceEntry.h */,
- CB38FD4F1CCF937E00592A3F /* JSPerformanceEntryList.cpp */,
- CB38FD501CCF937E00592A3F /* JSPerformanceEntryList.h */,
8A9A586E11E84C35008ACFD1 /* JSPerformanceNavigation.cpp */,
8A9A586F11E84C36008ACFD1 /* JSPerformanceNavigation.h */,
CB38FD581CD2314500592A3F /* JSPerformanceResourceTiming.cpp */,
@@ -26448,7 +26434,6 @@
FDA15EB212B03EE1003A583A /* JSPannerNode.h in Headers */,
8A9A587511E84C81008ACFD1 /* JSPerformance.h in Headers */,
CB38FD521CCF939400592A3F /* JSPerformanceEntry.h in Headers */,
- CB38FD541CCF939E00592A3F /* JSPerformanceEntryList.h in Headers */,
8A9A587111E84C36008ACFD1 /* JSPerformanceNavigation.h in Headers */,
CB38FD5B1CD2325B00592A3F /* JSPerformanceResourceTiming.h in Headers */,
8A9A588811E84F37008ACFD1 /* JSPerformanceTiming.h in Headers */,
@@ -27133,7 +27118,6 @@
8A7CC96B12076D73001D4588 /* PendingScript.h in Headers */,
8A844D0511D3C18E0014065C /* Performance.h in Headers */,
86BE340115058CB200CE0FD8 /* PerformanceEntry.h in Headers */,
- 86BE340415058CB200CE0FD8 /* PerformanceEntryList.h in Headers */,
8AF4E55611DC5A36000ED3DE /* PerformanceNavigation.h in Headers */,
86512EDF154A2AEF00A90426 /* PerformanceResourceTiming.h in Headers */,
8AF4E55C11DC5A63000ED3DE /* PerformanceTiming.h in Headers */,
@@ -30233,7 +30217,6 @@
E51A81DF17298D7700BFCA61 /* JSPerformance.cpp in Sources */,
CB38FD511CCF938900592A3F /* JSPerformanceEntry.cpp in Sources */,
CB38FD571CD21E2A00592A3F /* JSPerformanceEntryCustom.cpp in Sources */,
- CB38FD531CCF939B00592A3F /* JSPerformanceEntryList.cpp in Sources */,
8A9A587011E84C36008ACFD1 /* JSPerformanceNavigation.cpp in Sources */,
CB38FD5A1CD2325800592A3F /* JSPerformanceResourceTiming.cpp in Sources */,
0F43C85F189E15A600019AE2 /* JSPerformanceTiming.cpp in Sources */,
@@ -30872,7 +30855,6 @@
8A7CC97012076F8A001D4588 /* PendingScript.cpp in Sources */,
E526AF3F1727F8F200E41781 /* Performance.cpp in Sources */,
CB38FD4B1CCCF36600592A3F /* PerformanceEntry.cpp in Sources */,
- 86BE340315058CB200CE0FD8 /* PerformanceEntryList.cpp in Sources */,
8AF4E55511DC5A36000ED3DE /* PerformanceNavigation.cpp in Sources */,
86512EDE154A2AEF00A90426 /* PerformanceResourceTiming.cpp in Sources */,
0F43C85D189E10CF00019AE2 /* PerformanceTiming.cpp in Sources */,
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm (204640 => 204641)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm 2016-08-19 18:24:50 UTC (rev 204640)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm 2016-08-19 18:30:10 UTC (rev 204641)
@@ -65,7 +65,7 @@
"Geolocation" => 1, "HTMLOptionsCollection" => 1, "History" => 1,
"KeyboardEvent" => 1, "KeyframeEffect" => 1, "MediaError" => 1, "MediaController" => 1,
"MouseEvent" => 1, "MediaQueryList" => 1, "Navigator" => 1, "NodeFilter" => 1,
- "Performance" => 1, "PerformanceEntry" => 1, "PerformanceEntryList" => 1, "PerformanceNavigation" => 1, "PerformanceTiming" => 1,
+ "Performance" => 1, "PerformanceEntry" => 1, "PerformanceNavigation" => 1, "PerformanceTiming" => 1,
"Range" => 1, "Screen" => 1, "SpeechSynthesis" => 1, "SpeechSynthesisVoice" => 1,
"Storage" => 1, "StyleMedia" => 1, "TextTrack" => 1, "TextTrackCueList" => 1,
"TimeRanges" => 1, "Touch" => 1, "UIEvent" => 1, "UserMessageHandler" => 1, "UserMessageHandlersNamespace" => 1,
Modified: trunk/Source/WebCore/page/Performance.cpp (204640 => 204641)
--- trunk/Source/WebCore/page/Performance.cpp 2016-08-19 18:24:50 UTC (rev 204640)
+++ trunk/Source/WebCore/page/Performance.cpp 2016-08-19 18:30:10 UTC (rev 204641)
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2010 Google Inc. All rights reserved.
* Copyright (C) 2012 Intel Inc. All rights reserved.
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -88,53 +89,53 @@
return m_timing.get();
}
-RefPtr<PerformanceEntryList> Performance::getEntries() const
+Vector<RefPtr<PerformanceEntry>> Performance::getEntries() const
{
- RefPtr<PerformanceEntryList> entries = PerformanceEntryList::create();
+ Vector<RefPtr<PerformanceEntry>> entries;
- entries->appendAll(m_resourceTimingBuffer);
+ entries.appendVector(m_resourceTimingBuffer);
#if ENABLE(USER_TIMING)
if (m_userTiming) {
- entries->appendAll(m_userTiming->getMarks());
- entries->appendAll(m_userTiming->getMeasures());
+ entries.appendVector(m_userTiming->getMarks());
+ entries.appendVector(m_userTiming->getMeasures());
}
#endif // ENABLE(USER_TIMING)
- entries->sort();
+ std::sort(entries.begin(), entries.end(), PerformanceEntry::startTimeCompareLessThan);
return entries;
}
-RefPtr<PerformanceEntryList> Performance::getEntriesByType(const String& entryType)
+Vector<RefPtr<PerformanceEntry>> Performance::getEntriesByType(const String& entryType) const
{
- RefPtr<PerformanceEntryList> entries = PerformanceEntryList::create();
+ Vector<RefPtr<PerformanceEntry>> entries;
if (equalLettersIgnoringASCIICase(entryType, "resource")) {
for (auto& resource : m_resourceTimingBuffer)
- entries->append(resource);
+ entries.append(resource);
}
#if ENABLE(USER_TIMING)
if (m_userTiming) {
if (equalLettersIgnoringASCIICase(entryType, "mark"))
- entries->appendAll(m_userTiming->getMarks());
+ entries.appendVector(m_userTiming->getMarks());
else if (equalLettersIgnoringASCIICase(entryType, "measure"))
- entries->appendAll(m_userTiming->getMeasures());
+ entries.appendVector(m_userTiming->getMeasures());
}
#endif
- entries->sort();
+ std::sort(entries.begin(), entries.end(), PerformanceEntry::startTimeCompareLessThan);
return entries;
}
-RefPtr<PerformanceEntryList> Performance::getEntriesByName(const String& name, const String& entryType)
+Vector<RefPtr<PerformanceEntry>> Performance::getEntriesByName(const String& name, const String& entryType) const
{
- RefPtr<PerformanceEntryList> entries = PerformanceEntryList::create();
+ Vector<RefPtr<PerformanceEntry>> entries;
if (entryType.isNull() || equalLettersIgnoringASCIICase(entryType, "resource")) {
for (auto& resource : m_resourceTimingBuffer) {
if (resource->name() == name)
- entries->append(resource);
+ entries.append(resource);
}
}
@@ -141,13 +142,13 @@
#if ENABLE(USER_TIMING)
if (m_userTiming) {
if (entryType.isNull() || equalLettersIgnoringASCIICase(entryType, "mark"))
- entries->appendAll(m_userTiming->getMarks(name));
+ entries.appendVector(m_userTiming->getMarks(name));
if (entryType.isNull() || equalLettersIgnoringASCIICase(entryType, "measure"))
- entries->appendAll(m_userTiming->getMeasures(name));
+ entries.appendVector(m_userTiming->getMeasures(name));
}
#endif
- entries->sort();
+ std::sort(entries.begin(), entries.end(), PerformanceEntry::startTimeCompareLessThan);
return entries;
}
Modified: trunk/Source/WebCore/page/Performance.h (204640 => 204641)
--- trunk/Source/WebCore/page/Performance.h 2016-08-19 18:24:50 UTC (rev 204640)
+++ trunk/Source/WebCore/page/Performance.h 2016-08-19 18:30:10 UTC (rev 204641)
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2010 Google Inc. All rights reserved.
* Copyright (C) 2012 Intel Inc. All rights reserved.
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -29,14 +30,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef Performance_h
-#define Performance_h
+#pragma once
#if ENABLE(WEB_TIMING)
#include "DOMWindowProperty.h"
#include "EventTarget.h"
-#include "PerformanceEntryList.h"
#include "PerformanceNavigation.h"
#include "PerformanceTiming.h"
#include "ScriptWrappable.h"
@@ -47,6 +46,7 @@
namespace WebCore {
class Document;
+class PerformanceEntry;
class ResourceRequest;
class ResourceResponse;
class UserTiming;
@@ -63,9 +63,9 @@
PerformanceTiming* timing() const;
double now() const;
- RefPtr<PerformanceEntryList> getEntries() const;
- RefPtr<PerformanceEntryList> getEntriesByType(const String& entryType);
- RefPtr<PerformanceEntryList> getEntriesByName(const String& name, const String& entryType);
+ Vector<RefPtr<PerformanceEntry>> getEntries() const;
+ Vector<RefPtr<PerformanceEntry>> getEntriesByType(const String& entryType) const;
+ Vector<RefPtr<PerformanceEntry>> getEntriesByName(const String& name, const String& entryType) const;
void clearResourceTimings();
void setResourceTimingBufferSize(unsigned);
@@ -106,5 +106,3 @@
}
#endif // ENABLE(WEB_TIMING)
-
-#endif // Performance_h
Modified: trunk/Source/WebCore/page/Performance.idl (204640 => 204641)
--- trunk/Source/WebCore/page/Performance.idl 2016-08-19 18:24:50 UTC (rev 204640)
+++ trunk/Source/WebCore/page/Performance.idl 2016-08-19 18:30:10 UTC (rev 204641)
@@ -59,3 +59,4 @@
unrestricted double now();
};
+typedef sequence<PerformanceEntry> PerformanceEntryList;
Deleted: trunk/Source/WebCore/page/PerformanceEntryList.cpp (204640 => 204641)
--- trunk/Source/WebCore/page/PerformanceEntryList.cpp 2016-08-19 18:24:50 UTC (rev 204640)
+++ trunk/Source/WebCore/page/PerformanceEntryList.cpp 2016-08-19 18:30:10 UTC (rev 204641)
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- * Copyright (C) 2012 Intel Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "PerformanceEntryList.h"
-
-#if ENABLE(WEB_TIMING)
-
-#include "PerformanceEntry.h"
-
-namespace WebCore {
-
-PerformanceEntryList::PerformanceEntryList()
-{
-}
-
-PerformanceEntryList::~PerformanceEntryList()
-{
-}
-
-unsigned PerformanceEntryList::length() const
-{
- return m_entries.size();
-}
-
-PerformanceEntry* PerformanceEntryList::item(unsigned index)
-{
- if (index < m_entries.size())
- return m_entries[index].get();
- return 0;
-}
-
-void PerformanceEntryList::append(PassRefPtr<PerformanceEntry> entry)
-{
- m_entries.append(entry);
-}
-
-void PerformanceEntryList::appendAll(const Vector<RefPtr<PerformanceEntry>>& entries)
-{
- m_entries.appendVector(entries);
-}
-
-void PerformanceEntryList::sort()
-{
- std::sort(m_entries.begin(), m_entries.end(), PerformanceEntry::startTimeCompareLessThan);
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(WEB_TIMING)
Deleted: trunk/Source/WebCore/page/PerformanceEntryList.h (204640 => 204641)
--- trunk/Source/WebCore/page/PerformanceEntryList.h 2016-08-19 18:24:50 UTC (rev 204640)
+++ trunk/Source/WebCore/page/PerformanceEntryList.h 2016-08-19 18:30:10 UTC (rev 204641)
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- * Copyright (C) 2012 Intel Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef PerformanceEntryList_h
-#define PerformanceEntryList_h
-
-#if ENABLE(WEB_TIMING)
-
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-#include <wtf/Vector.h>
-
-namespace WebCore {
-
-class PerformanceEntry;
-
-class PerformanceEntryList : public RefCounted<PerformanceEntryList> {
-public:
- static Ref<PerformanceEntryList> create() { return adoptRef(*new PerformanceEntryList); }
- ~PerformanceEntryList();
-
- unsigned length() const;
- PerformanceEntry* item(unsigned index);
-
- void append(PassRefPtr<PerformanceEntry>);
- void appendAll(const Vector<RefPtr<PerformanceEntry>>&);
-
- void sort();
-
-private:
- PerformanceEntryList();
-
- Vector<RefPtr<PerformanceEntry>> m_entries;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(WEB_TIMING)
-#endif // PerformanceEntryList_h
Deleted: trunk/Source/WebCore/page/PerformanceEntryList.idl (204640 => 204641)
--- trunk/Source/WebCore/page/PerformanceEntryList.idl 2016-08-19 18:24:50 UTC (rev 204640)
+++ trunk/Source/WebCore/page/PerformanceEntryList.idl 2016-08-19 18:30:10 UTC (rev 204641)
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-// See: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PerformanceTimeline/Overview.html
-[
- NoInterfaceObject,
- Conditional=WEB_TIMING,
- EnabledAtRuntime=ResourceTiming,
- ImplementationLacksVTable,
-] interface PerformanceEntryList {
- readonly attribute unsigned long length;
- getter PerformanceEntry item(unsigned long index);
-};