Changeset 245427 in webkit


Ignore:
Timestamp:
May 16, 2019 4:33:39 PM (5 years ago)
Author:
wilander@apple.com
Message:

Storage Access API: Call completion handlers in NetworkConnectionToWebProcess::hasStorageAccess() and NetworkConnectionToWebProcess::requestStorageAccess() when feature is off
https://bugs.webkit.org/show_bug.cgi?id=197967
<rdar://problem/50753129>

Reviewed by Brent Fulgham.

Source/WebKit:

NetworkConnectionToWebProcess::hasStorageAccess() and NetworkConnectionToWebProcess::requestStorageAccess()
should call their completion handlers when there is no Resource Load Statistics object, i.e. when Resource
Load Statistics is off. This happens for ephemeral sessions which made code for federated login providers
hang, waiting for the result to document.hasStorageAccess().

The existing layout test case was augmented to use an ephemeral session.

  • NetworkProcess/NetworkConnectionToWebProcess.cpp:

(WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
(WebKit::NetworkConnectionToWebProcess::requestStorageAccess):

LayoutTests:

  • http/tests/storageAccess/has-storage-access-true-if-feature-off.html:
  • platform/mac-wk2/TestExpectations:

Test case marked as [ Pass ].

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r245406 r245427  
     12019-05-16  John Wilander  <wilander@apple.com>
     2
     3        Storage Access API: Call completion handlers in NetworkConnectionToWebProcess::hasStorageAccess() and NetworkConnectionToWebProcess::requestStorageAccess() when feature is off
     4        https://bugs.webkit.org/show_bug.cgi?id=197967
     5        <rdar://problem/50753129>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        * http/tests/storageAccess/has-storage-access-true-if-feature-off.html:
     10        * platform/mac-wk2/TestExpectations:
     11            Test case marked as [ Pass ].
     12
    1132019-05-16  Ross Kirsling  <ross.kirsling@sony.com>
    214
  • trunk/LayoutTests/http/tests/storageAccess/has-storage-access-true-if-feature-off.html

    r245025 r245427  
    88        description("Tests that document.hasStorageAccess() returns true for a 3rd-party iframe if there is no way to request access (feature off).");
    99        jsTestIsAsync = true;
     10
     11        if (window.testRunner)
     12            testRunner.setPrivateBrowsingEnabled(true);
    1013
    1114        window.addEventListener("message", receiveMessage, false);
  • trunk/LayoutTests/platform/mac-wk2/TestExpectations

    r245340 r245427  
    732732[ HighSierra+ ] http/tests/storageAccess/deny-with-prompt-does-not-preserve-gesture.html [ Skip ]
    733733[ HighSierra+ ] http/tests/storageAccess/deny-without-prompt-preserves-gesture.html [ Pass ]
     734[ HighSierra+ ] http/tests/storageAccess/has-storage-access-true-if-feature-off.html [ Pass ]
    734735
    735736# As of https://trac.webkit.org/changeset/227762 the timestampResolution is just 5 seconds which makes this test flaky
  • trunk/Source/WebKit/ChangeLog

    r245418 r245427  
     12019-05-16  John Wilander  <wilander@apple.com>
     2
     3        Storage Access API: Call completion handlers in NetworkConnectionToWebProcess::hasStorageAccess() and NetworkConnectionToWebProcess::requestStorageAccess() when feature is off
     4        https://bugs.webkit.org/show_bug.cgi?id=197967
     5        <rdar://problem/50753129>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        NetworkConnectionToWebProcess::hasStorageAccess() and NetworkConnectionToWebProcess::requestStorageAccess()
     10        should call their completion handlers when there is no Resource Load Statistics object, i.e. when Resource
     11        Load Statistics is off. This happens for ephemeral sessions which made code for federated login providers
     12        hang, waiting for the result to document.hasStorageAccess().
     13
     14        The existing layout test case was augmented to use an ephemeral session.
     15
     16        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
     17        (WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
     18        (WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
     19
    1202019-05-16  Alex Christensen  <achristensen@webkit.org>
    221
  • trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp

    r245025 r245427  
    683683{
    684684    if (auto networkSession = networkProcess().networkSession(sessionID)) {
    685         if (auto* resourceLoadStatistics = networkSession->resourceLoadStatistics())
     685        if (auto* resourceLoadStatistics = networkSession->resourceLoadStatistics()) {
    686686            resourceLoadStatistics->hasStorageAccess(subFrameDomain, topFrameDomain, frameID, pageID, WTFMove(completionHandler));
    687     }
     687            return;
     688        }
     689    }
     690
     691    completionHandler(true);
    688692}
    689693
     
    691695{
    692696    if (auto networkSession = networkProcess().networkSession(sessionID)) {
    693         if (auto* resourceLoadStatistics = networkSession->resourceLoadStatistics())
     697        if (auto* resourceLoadStatistics = networkSession->resourceLoadStatistics()) {
    694698            resourceLoadStatistics->requestStorageAccess(subFrameDomain, topFrameDomain, frameID, pageID, WTFMove(completionHandler));
    695     }
     699            return;
     700        }
     701    }
     702
     703    completionHandler(WebCore::StorageAccessWasGranted::Yes, WebCore::StorageAccessPromptWasShown::No);
    696704}
    697705
Note: See TracChangeset for help on using the changeset viewer.