Resource Load Statistics: User interaction should always go to top document
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Jul 2017 02:18:56 +0000 (02:18 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Jul 2017 02:18:56 +0000 (02:18 +0000)
commit1c1e1b04cce83eebfc75685f4dc382a8aeae9691
tree78f9e7813358d682594ec925a5e46c13ec635928
parentf5af38455aaa7b173c31b5e3574eeb8f4f47822f
Resource Load Statistics: User interaction should always go to top document
https://bugs.webkit.org/show_bug.cgi?id=174120
<rdar://problem/33117899>

Patch by John Wilander <wilander@apple.com> on 2017-07-08
Reviewed by Chris Dumez.

Source/WebCore:

Test: http/tests/loading/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame.html

* dom/UserGestureIndicator.cpp:
(WebCore::UserGestureIndicator::UserGestureIndicator):
    Now logs user interaction for the top document.
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::setThrottledObserverNotifications):
    Test infrastructure.
(WebCore::ResourceLoadObserver::setNotificationCallback):
    Callback now takes a ResourceLoadObserver::NotificationType.
(WebCore::ResourceLoadObserver::logFrameNavigation):
    Submits the configured ResourceLoadObserver::NotificationType.
(WebCore::ResourceLoadObserver::logSubresourceLoading):
    Submits the configured ResourceLoadObserver::NotificationType.
(WebCore::ResourceLoadObserver::logWebSocketLoading):
    Submits the configured ResourceLoadObserver::NotificationType.
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
    Submits the configured ResourceLoadObserver::NotificationType.
* loader/ResourceLoadObserver.h:
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
    Resets to throttled notifications.
(WebCore::Internals::setResourceLoadStatisticsThrottledObserverNotifications):
    Test infrastructure.
* testing/Internals.h:
* testing/Internals.idl:
    Added internals.setResourceLoadStatisticsThrottledObserverNotifications().

LayoutTests:

* http/tests/loading/resourceLoadStatistics/resources/dummy.html: Added.
* http/tests/loading/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame-expected.txt: Added.
* http/tests/loading/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame.html: Added.
* platform/mac-wk2/TestExpectations:
    Added as [ Pass ].

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219284 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/loading/resourceLoadStatistics/resources/dummy.html [new file with mode: 0644]
LayoutTests/http/tests/loading/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/loading/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame.html [new file with mode: 0644]
LayoutTests/platform/ios-wk2/TestExpectations
LayoutTests/platform/mac-wk2/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/dom/UserGestureIndicator.cpp
Source/WebCore/loader/ResourceLoadObserver.cpp
Source/WebCore/loader/ResourceLoadObserver.h
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl