Title: [226104] releases/WebKitGTK/webkit-2.18
Revision
226104
Author
carlo...@webkit.org
Date
2017-12-18 23:48:30 -0800 (Mon, 18 Dec 2017)

Log Message

Merge r225381 - Extra PerformanceEntryList entry after iframe navigation
https://bugs.webkit.org/show_bug.cgi?id=178433

Reviewed by Joseph Pecoraro.

Source/WebCore:

Test: http/tests/security/PerformanceEntryList-parent-only-first-navigation.html

When an iframe is loaded, its main resource load should be reported to the parent frame's PerformanceEntryList.
Subsequent main resource loads should not.

* loader/FrameLoader.h:
(WebCore::FrameLoader::shouldReportResourceTimingToParentFrame):
* loader/ResourceTimingInformation.cpp:
(WebCore::ResourceTimingInformation::addResourceTiming):

LayoutTests:

* http/tests/security/PerformanceEntryList-parent-only-first-navigation-expected.txt: Added.
* http/tests/security/PerformanceEntryList-parent-only-first-navigation.html: Added.
* http/tests/security/resources/navigate-and-postMessage.html: Added.
* http/tests/security/resources/postMessage.html: Added.

Fix non-unified build after r225381
https://bugs.webkit.org/show_bug.cgi?id=180434

Reviewed by Keith Miller.

* loader/ResourceTimingInformation.cpp:
FrameLoader.h is included in other files that are combined with this file in unified builds,
but we need to merge r225381 to a branch that doesn't use unified builds.  This build failure
would've come up randomly in the future when we add files, too.

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.18/LayoutTests/ChangeLog (226103 => 226104)


--- releases/WebKitGTK/webkit-2.18/LayoutTests/ChangeLog	2017-12-19 07:22:15 UTC (rev 226103)
+++ releases/WebKitGTK/webkit-2.18/LayoutTests/ChangeLog	2017-12-19 07:48:30 UTC (rev 226104)
@@ -1,3 +1,15 @@
+2017-11-30  Alex Christensen  <achristen...@webkit.org>
+
+        Extra PerformanceEntryList entry after iframe navigation
+        https://bugs.webkit.org/show_bug.cgi?id=178433
+
+        Reviewed by Joseph Pecoraro.
+
+        * http/tests/security/PerformanceEntryList-parent-only-first-navigation-expected.txt: Added.
+        * http/tests/security/PerformanceEntryList-parent-only-first-navigation.html: Added.
+        * http/tests/security/resources/navigate-and-postMessage.html: Added.
+        * http/tests/security/resources/postMessage.html: Added.
+
 2017-11-03  Ryosuke Niwa  <rn...@webkit.org>
 
         Crash inside ChildListMutationAccumulator::enqueueMutationRecord()

Added: releases/WebKitGTK/webkit-2.18/LayoutTests/http/tests/security/PerformanceEntryList-parent-only-first-navigation-expected.txt (0 => 226104)


--- releases/WebKitGTK/webkit-2.18/LayoutTests/http/tests/security/PerformanceEntryList-parent-only-first-navigation-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.18/LayoutTests/http/tests/security/PerformanceEntryList-parent-only-first-navigation-expected.txt	2017-12-19 07:48:30 UTC (rev 226104)
@@ -0,0 +1,2 @@
+ALERT: posting message 1 http://127.0.0.1:8000/security/resources/navigate-and-postMessage.html
+

Added: releases/WebKitGTK/webkit-2.18/LayoutTests/http/tests/security/PerformanceEntryList-parent-only-first-navigation.html (0 => 226104)


--- releases/WebKitGTK/webkit-2.18/LayoutTests/http/tests/security/PerformanceEntryList-parent-only-first-navigation.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.18/LayoutTests/http/tests/security/PerformanceEntryList-parent-only-first-navigation.html	2017-12-19 07:48:30 UTC (rev 226104)
@@ -0,0 +1,13 @@
+<script>
+    if (window.testRunner) {
+        testRunner.waitUntilDone();
+        testRunner.dumpAsText();
+    }
+    window.addEventListener("message", (e)=>{
+        var entries = performance.getEntriesByType("resource");
+        alert(e.data + " " + entries.length + " " + entries[0].name);
+        if (window.testRunner)
+            testRunner.notifyDone();
+    }, false);
+</script>
+<iframe src=""

Added: releases/WebKitGTK/webkit-2.18/LayoutTests/http/tests/security/resources/navigate-and-postMessage.html (0 => 226104)


--- releases/WebKitGTK/webkit-2.18/LayoutTests/http/tests/security/resources/navigate-and-postMessage.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.18/LayoutTests/http/tests/security/resources/navigate-and-postMessage.html	2017-12-19 07:48:30 UTC (rev 226104)
@@ -0,0 +1,3 @@
+<script>
+    window.location = "postMessage.html";
+</script>

Added: releases/WebKitGTK/webkit-2.18/LayoutTests/http/tests/security/resources/postMessage.html (0 => 226104)


--- releases/WebKitGTK/webkit-2.18/LayoutTests/http/tests/security/resources/postMessage.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.18/LayoutTests/http/tests/security/resources/postMessage.html	2017-12-19 07:48:30 UTC (rev 226104)
@@ -0,0 +1,3 @@
+<script>
+    window.parent.postMessage("posting message", "*");
+</script>

Modified: releases/WebKitGTK/webkit-2.18/Source/WebCore/ChangeLog (226103 => 226104)


--- releases/WebKitGTK/webkit-2.18/Source/WebCore/ChangeLog	2017-12-19 07:22:15 UTC (rev 226103)
+++ releases/WebKitGTK/webkit-2.18/Source/WebCore/ChangeLog	2017-12-19 07:48:30 UTC (rev 226104)
@@ -1,3 +1,32 @@
+2017-12-05  Alex Christensen  <achristen...@webkit.org>
+
+        Fix non-unified build after r225381
+        https://bugs.webkit.org/show_bug.cgi?id=180434
+
+        Reviewed by Keith Miller.
+
+        * loader/ResourceTimingInformation.cpp:
+        FrameLoader.h is included in other files that are combined with this file in unified builds,
+        but we need to merge r225381 to a branch that doesn't use unified builds.  This build failure
+        would've come up randomly in the future when we add files, too.
+
+2017-11-30  Alex Christensen  <achristen...@webkit.org>
+
+        Extra PerformanceEntryList entry after iframe navigation
+        https://bugs.webkit.org/show_bug.cgi?id=178433
+
+        Reviewed by Joseph Pecoraro.
+
+        Test: http/tests/security/PerformanceEntryList-parent-only-first-navigation.html
+
+        When an iframe is loaded, its main resource load should be reported to the parent frame's PerformanceEntryList.
+        Subsequent main resource loads should not.
+
+        * loader/FrameLoader.h:
+        (WebCore::FrameLoader::shouldReportResourceTimingToParentFrame):
+        * loader/ResourceTimingInformation.cpp:
+        (WebCore::ResourceTimingInformation::addResourceTiming):
+
 2017-11-03  Ryosuke Niwa  <rn...@webkit.org>
 
         Crash inside ChildListMutationAccumulator::enqueueMutationRecord()

Modified: releases/WebKitGTK/webkit-2.18/Source/WebCore/loader/FrameLoader.h (226103 => 226104)


--- releases/WebKitGTK/webkit-2.18/Source/WebCore/loader/FrameLoader.h	2017-12-19 07:22:15 UTC (rev 226103)
+++ releases/WebKitGTK/webkit-2.18/Source/WebCore/loader/FrameLoader.h	2017-12-19 07:48:30 UTC (rev 226104)
@@ -157,6 +157,9 @@
     DocumentLoader* provisionalDocumentLoader() const { return m_provisionalDocumentLoader.get(); }
     FrameState state() const { return m_state; }
 
+    void setShouldReportResourceTimingToParentFrame(bool value) { m_shouldReportResourceTimingToParentFrame = value; }
+    bool shouldReportResourceTimingToParentFrame() { return m_shouldReportResourceTimingToParentFrame; };
+    
 #if PLATFORM(IOS)
     RetainPtr<CFDictionaryRef> connectionProperties(ResourceLoader*);
 #endif
@@ -415,6 +418,7 @@
     bool m_quickRedirectComing;
     bool m_sentRedirectNotification;
     bool m_inStopAllLoaders;
+    bool m_shouldReportResourceTimingToParentFrame { true };
 
     String m_outgoingReferrer;
 

Modified: releases/WebKitGTK/webkit-2.18/Source/WebCore/loader/ResourceTimingInformation.cpp (226103 => 226104)


--- releases/WebKitGTK/webkit-2.18/Source/WebCore/loader/ResourceTimingInformation.cpp	2017-12-19 07:22:15 UTC (rev 226103)
+++ releases/WebKitGTK/webkit-2.18/Source/WebCore/loader/ResourceTimingInformation.cpp	2017-12-19 07:48:30 UTC (rev 226104)
@@ -30,6 +30,7 @@
 #include "DOMWindow.h"
 #include "Document.h"
 #include "Frame.h"
+#include "FrameLoader.h"
 #include "HTMLFrameOwnerElement.h"
 #include "LoadTiming.h"
 #include "Performance.h"
@@ -69,8 +70,10 @@
         return;
 
     Document* initiatorDocument = &document;
-    if (resource.type() == CachedResource::MainResource)
+    if (resource.type() == CachedResource::MainResource && document.frame() && document.frame()->loader().shouldReportResourceTimingToParentFrame()) {
+        document.frame()->loader().setShouldReportResourceTimingToParentFrame(false);
         initiatorDocument = document.parentDocument();
+    }
     if (!initiatorDocument)
         return;
     if (!initiatorDocument->domWindow())
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to