Changeset 225381 in webkit


Ignore:
Timestamp:
Nov 30, 2017 9:27:11 PM (6 years ago)
Author:
achristensen@apple.com
Message:

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.
Location:
trunk
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r225379 r225381  
     12017-11-30  Alex Christensen  <achristensen@webkit.org>
     2
     3        Extra PerformanceEntryList entry after iframe navigation
     4        https://bugs.webkit.org/show_bug.cgi?id=178433
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        * http/tests/security/PerformanceEntryList-parent-only-first-navigation-expected.txt: Added.
     9        * http/tests/security/PerformanceEntryList-parent-only-first-navigation.html: Added.
     10        * http/tests/security/resources/navigate-and-postMessage.html: Added.
     11        * http/tests/security/resources/postMessage.html: Added.
     12
    1132017-11-30  Zalan Bujtas  <zalan@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r225379 r225381  
     12017-11-30  Alex Christensen  <achristensen@webkit.org>
     2
     3        Extra PerformanceEntryList entry after iframe navigation
     4        https://bugs.webkit.org/show_bug.cgi?id=178433
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        Test: http/tests/security/PerformanceEntryList-parent-only-first-navigation.html
     9
     10        When an iframe is loaded, its main resource load should be reported to the parent frame's PerformanceEntryList.
     11        Subsequent main resource loads should not.
     12
     13        * loader/FrameLoader.h:
     14        (WebCore::FrameLoader::shouldReportResourceTimingToParentFrame):
     15        * loader/ResourceTimingInformation.cpp:
     16        (WebCore::ResourceTimingInformation::addResourceTiming):
     17
    1182017-11-30  Zalan Bujtas  <zalan@apple.com>
    219
  • trunk/Source/WebCore/loader/FrameLoader.h

    r224902 r225381  
    159159    FrameState state() const { return m_state; }
    160160
     161    void setShouldReportResourceTimingToParentFrame(bool value) { m_shouldReportResourceTimingToParentFrame = value; }
     162    bool shouldReportResourceTimingToParentFrame() { return m_shouldReportResourceTimingToParentFrame; };
     163   
    161164#if PLATFORM(IOS)
    162165    RetainPtr<CFDictionaryRef> connectionProperties(ResourceLoader*);
     
    417420    bool m_sentRedirectNotification;
    418421    bool m_inStopAllLoaders;
     422    bool m_shouldReportResourceTimingToParentFrame { true };
    419423
    420424    String m_outgoingReferrer;
  • trunk/Source/WebCore/loader/ResourceTimingInformation.cpp

    r219954 r225381  
    7070
    7171    Document* initiatorDocument = &document;
    72     if (resource.type() == CachedResource::MainResource)
     72    if (resource.type() == CachedResource::MainResource && document.frame() && document.frame()->loader().shouldReportResourceTimingToParentFrame()) {
     73        document.frame()->loader().setShouldReportResourceTimingToParentFrame(false);
    7374        initiatorDocument = document.parentDocument();
     75    }
    7476    if (!initiatorDocument)
    7577        return;
Note: See TracChangeset for help on using the changeset viewer.