⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 283397 in webkit


Ignore:
Timestamp:
Oct 1, 2021, 1:45:06 PM (5 years ago)
Author:
Chris Dumez
Message:

Unreviewed, reverting r283274.

Broke HSTS.CrossOriginRedirect API test

Reverted changeset:

"Use isolated NSURLSessions for each first party registrable
domain"
https://bugs.webkit.org/show_bug.cgi?id=230750
https://commits.webkit.org/r283274

Location:
trunk
Files:
1 deleted
10 edited
2 copied
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r283395 r283397  
     12021-10-01  Chris Dumez  <cdumez@apple.com>
     2
     3        Unreviewed, reverting r283274.
     4
     5        Broke HSTS.CrossOriginRedirect API test
     6
     7        Reverted changeset:
     8
     9        "Use isolated NSURLSessions for each first party registrable
     10        domain"
     11        https://bugs.webkit.org/show_bug.cgi?id=230750
     12        https://commits.webkit.org/r283274
     13
    1142021-10-01  Simon Fraser  <simon.fraser@apple.com>
    215
  • trunk/LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-expected.txt

    r283396 r283397  
    1 Tests that the session is switched upon top frame navigation to a prevalent resource without user interaction.
     1Tests that the session is not switched upon top frame navigation to a prevalent resource without user interaction.
    22
    33On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
     
    66PASS Should have and has the session cookie.
    77PASS Should have and has the persistent cookie.
    8 PASS Origin has isolated session.
     8PASS Origin has no isolated session.
    99PASS successfullyParsed is true
    1010
  • trunk/LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.py

    r283396 r283397  
    1717<body onload="runTest()">
    1818<script>
    19     description("Tests that the session is switched upon top frame navigation to a prevalent resource without user interaction.");
     19    description("Tests that the session is not switched upon top frame navigation to a prevalent resource without user interaction.");
    2020    jsTestIsAsync = true;
    2121
     
    7474                    runTest();
    7575                });
    76                 break;
    7776            case "#step1":
    7877                setSessionCookie();
    7978                setPersistentCookie();
    8079                checkCookies(true, true);
    81                 if (testRunner.hasStatisticsIsolatedSession(prevalentOrigin))
    82                     testPassed("Origin has isolated session.");
    83                 else {
    84                     testFailed("Origin has no isolated session.");
     80                if (testRunner.hasStatisticsIsolatedSession(prevalentOrigin)) {
     81                    testFailed("Origin has isolated session.");
    8582                    setEnableFeature(false, finishJSTest);
    86                 }
    87                 document.location.href = nonPrevalentOrigin + "/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-without-interaction.py#step2";
     83                } else
     84                    testPassed("Origin has no isolated session.");
     85                document.location.href = nonPrevalentOrigin + "/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.py#step2";
    8886                break;
    8987            case "#step2":
     
    10098                break;
    10199            case "#step3":
    102                 document.location.href = prevalentOrigin + "/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-without-interaction.py#step4";
     100                document.location.href = prevalentOrigin + "/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.py#step4";
    103101                break;
    104102            case "#step4":
    105103                checkCookies(true, true);
    106104                if (testRunner.hasStatisticsIsolatedSession(prevalentOrigin))
    107                     testPassed("Origin has isolated session.");
     105                    testFailed("Origin has isolated session.");
    108106                else
    109                     testFailed("Origin has no isolated session.");
     107                    testPassed("Origin has no isolated session.");
    110108                setEnableFeature(false, finishJSTest);
    111109                break;
  • trunk/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-expected.txt

    r283396 r283397  
    1 Tests that the session is switched upon top frame navigation to a prevalent resource without user interaction.
     1Tests that the session is switched upon top frame navigation to a prevalent resource with user interaction.
    22
    33On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
  • trunk/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.py

    r283396 r283397  
    1717<body onload="runTest()">
    1818<script>
    19     description("Tests that the session is switched upon top frame navigation to a prevalent resource without user interaction.");
     19    description("Tests that the session is switched upon top frame navigation to a prevalent resource with user interaction.");
    2020    jsTestIsAsync = true;
    2121
     
    6767                if (document.location.origin !== prevalentOrigin)
    6868                    testFailed("Test is not starting out on " + prevalentOrigin + ".");
    69 
    7069                setEnableFeature(true, function () {
    7170                    if (testRunner.isStatisticsPrevalentResource(prevalentOrigin))
     
    7675                break;
    7776            case "#step1":
    78                 setSessionCookie();
    79                 setPersistentCookie();
    80                 checkCookies(true, true);
    81                 if (testRunner.hasStatisticsIsolatedSession(prevalentOrigin))
    82                     testPassed("Origin has isolated session.");
    83                 else {
    84                     testFailed("Origin has no isolated session.");
    85                     setEnableFeature(false, finishJSTest);
    86                 }
    87                 document.location.href = nonPrevalentOrigin + "/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-without-interaction.py#step2";
     77                testRunner.setStatisticsHasHadUserInteraction(prevalentOrigin, true, function() {
     78                    setSessionCookie();
     79                    setPersistentCookie();
     80                    checkCookies(true, true);
     81                    if (testRunner.hasStatisticsIsolatedSession(prevalentOrigin)) {
     82                        testFailed("Origin has isolated session.");
     83                        setEnableFeature(false, finishJSTest);
     84                    } else
     85                        testPassed("Origin has no isolated session.");
     86                    document.location.href = nonPrevalentOrigin + "/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.py#step2";
     87                });
    8888                break;
    8989            case "#step2":
     
    100100                break;
    101101            case "#step3":
    102                 document.location.href = prevalentOrigin + "/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-without-interaction.py#step4";
     102                document.location.href = prevalentOrigin + "/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.py#step4";
    103103                break;
    104104            case "#step4":
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r283377 r283397  
     12021-10-01  Chris Dumez  <cdumez@apple.com>
     2
     3        Unreviewed, reverting r283274.
     4
     5        Broke HSTS.CrossOriginRedirect API test
     6
     7        Reverted changeset:
     8
     9        "Use isolated NSURLSessions for each first party registrable
     10        domain"
     11        https://bugs.webkit.org/show_bug.cgi?id=230750
     12        https://commits.webkit.org/r283274
     13
    1142021-10-01  Youenn Fablet  <youenn@apple.com>
    215
  • trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/connection-pool/network-partition-key-expected.txt

    r283274 r283397  
    11
    22
    3 PASS With credentials
    4 PASS Without credentials
    5 PASS Cross-site resources with credentials
    6 PASS Cross-site resources without credentials
    7 PASS Iframes
    8 PASS Workers
    9 PASS Workers with cross-site resources
     3FAIL With credentials promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\""
     4FAIL Without credentials promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\""
     5FAIL Cross-site resources with credentials promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\""
     6FAIL Cross-site resources without credentials promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\""
     7FAIL Iframes promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\""
     8FAIL Workers promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\""
     9FAIL Workers with cross-site resources promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\""
    1010FAIL CSP sandbox promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\""
    1111FAIL about:blank from opaque origin iframe promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\""
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r283274 r283397  
    896896
    897897webkit.org/b/209727 fast/forms/placeholder-content-line-height.html [ ImageOnlyFailure ]
     898
     899webkit.org/b/210487 http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.py [ Failure ]
    898900
    899901webkit.org/b/210796 http/tests/resourceLoadStatistics/standalone-web-application-exempt-from-website-data-deletion.html [ Failure ]
  • trunk/LayoutTests/platform/wpe/TestExpectations

    r283358 r283397  
    601601webkit.org/b/210262 fast/selectors/text-field-selection-stroke-color.html [ ImageOnlyFailure ]
    602602webkit.org/b/210262 fast/selectors/text-field-selection-text-shadow.html [ ImageOnlyFailure ]
     603
     604webkit.org/b/210487 http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.py [ Failure ]
    603605
    604606webkit.org/b/211563 fast/text-indicator/text-indicator-estimated-color-with-implicit-newline.html [ Failure ]
  • trunk/Source/WebCore/ChangeLog

    r283394 r283397  
     12021-10-01  Chris Dumez  <cdumez@apple.com>
     2
     3        Unreviewed, reverting r283274.
     4
     5        Broke HSTS.CrossOriginRedirect API test
     6
     7        Reverted changeset:
     8
     9        "Use isolated NSURLSessions for each first party registrable
     10        domain"
     11        https://bugs.webkit.org/show_bug.cgi?id=230750
     12        https://commits.webkit.org/r283274
     13
    1142021-10-01  Kate Cheney  <katherine_cheney@apple.com>
    215
  • trunk/Source/WebCore/workers/service/server/SWServer.cpp

    r283295 r283397  
    442442URL static inline originURL(const SecurityOrigin& origin)
    443443{
    444     return URL(URL(), origin.data().toString());
     444    URL url;
     445    url.setProtocol(origin.protocol());
     446    url.setHost(origin.host());
     447    url.setPort(origin.port());
     448    return url;
    445449}
    446450
  • trunk/Source/WebKit/ChangeLog

    r283396 r283397  
     12021-10-01  Chris Dumez  <cdumez@apple.com>
     2
     3        Unreviewed, reverting r283274.
     4
     5        Broke HSTS.CrossOriginRedirect API test
     6
     7        Reverted changeset:
     8
     9        "Use isolated NSURLSessions for each first party registrable
     10        domain"
     11        https://bugs.webkit.org/show_bug.cgi?id=230750
     12        https://commits.webkit.org/r283274
     13
    1142021-10-01  Brent Fulgham  <bfulgham@apple.com>
    215
  • trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h

    r283274 r283397  
    7070    SessionWrapper sessionWithCredentialStorage;
    7171    SessionWrapper sessionWithoutCredentialStorage;
    72     MonotonicTime lastUsed;
     72    WallTime lastUsed;
    7373};
    7474
  • trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm

    r283376 r283397  
    9797CFStringRef const WebKit2HTTPProxyDefaultsKey = static_cast<CFStringRef>(@"WebKit2HTTPProxy");
    9898CFStringRef const WebKit2HTTPSProxyDefaultsKey = static_cast<CFStringRef>(@"WebKit2HTTPSProxy");
     99
     100constexpr unsigned maxNumberOfIsolatedSessions { 10 };
    99101
    100102static NSURLSessionResponseDisposition toNSURLSessionResponseDisposition(WebCore::PolicyAction disposition)
     
    14251427    if (isParentProcessAFullWebBrowser(networkProcess()))
    14261428        shouldBeConsideredAppBound = NavigatingToAppBoundDomain::No;
     1429#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
     1430    if (auto* storageSession = networkStorageSession()) {
     1431        auto firstParty = WebCore::RegistrableDomain(request.firstPartyForCookies());
     1432        if (storageSession->shouldBlockThirdPartyCookiesButKeepFirstPartyCookiesFor(firstParty))
     1433            return sessionSetForPage(webPageProxyID).isolatedSession(storedCredentialsPolicy, firstParty, shouldBeConsideredAppBound, *this);
     1434    } else
     1435        ASSERT_NOT_REACHED();
     1436#endif
    14271437
    14281438#if ENABLE(APP_BOUND_DOMAINS)
     
    14311441#endif
    14321442
    1433     auto firstParty = WebCore::RegistrableDomain(request.firstPartyForCookies());
    1434     if (firstParty.isEmpty())
    1435         firstParty = WebCore::RegistrableDomain(request.url());
    1436 
    1437     return sessionSetForPage(webPageProxyID).isolatedSession(storedCredentialsPolicy, firstParty, shouldBeConsideredAppBound, *this);
     1443    switch (storedCredentialsPolicy) {
     1444    case WebCore::StoredCredentialsPolicy::Use:
     1445        return sessionSetForPage(webPageProxyID).sessionWithCredentialStorage;
     1446    case WebCore::StoredCredentialsPolicy::DoNotUse:
     1447        return sessionSetForPage(webPageProxyID).sessionWithoutCredentialStorage;
     1448    case WebCore::StoredCredentialsPolicy::EphemeralStateless:
     1449        return initializeEphemeralStatelessSessionIfNeeded(webPageProxyID, NavigatingToAppBoundDomain::No);
     1450    }
    14381451}
    14391452
     
    14921505SessionWrapper& SessionSet::isolatedSession(WebCore::StoredCredentialsPolicy storedCredentialsPolicy, const WebCore::RegistrableDomain firstPartyDomain, NavigatingToAppBoundDomain isNavigatingToAppBoundDomain, NetworkSessionCocoa& session)
    14931506{
    1494     auto addResult = isolatedSessions.ensure(firstPartyDomain, [this, &session, isNavigatingToAppBoundDomain] {
     1507    auto& entry = isolatedSessions.ensure(firstPartyDomain, [this, &session, isNavigatingToAppBoundDomain] {
    14951508        auto newEntry = makeUnique<IsolatedSession>();
    14961509        newEntry->sessionWithCredentialStorage.initialize(sessionWithCredentialStorage.session.get().configuration, session, WebCore::StoredCredentialsPolicy::Use, isNavigatingToAppBoundDomain);
    14971510        newEntry->sessionWithoutCredentialStorage.initialize(sessionWithoutCredentialStorage.session.get().configuration, session, WebCore::StoredCredentialsPolicy::DoNotUse, isNavigatingToAppBoundDomain);
    14981511        return newEntry;
    1499     });
    1500 
    1501     auto now = MonotonicTime::now();
    1502     auto& isolatedSession = addResult.iterator->value;
    1503     isolatedSession->lastUsed = now;
     1512    }).iterator->value;
     1513
     1514    entry->lastUsed = WallTime::now();
    15041515
    15051516    auto& sessionWrapper = [&] (auto storedCredentialsPolicy) -> SessionWrapper& {
     
    15071518        case WebCore::StoredCredentialsPolicy::Use:
    15081519            LOG(NetworkSession, "Using isolated NSURLSession with credential storage.");
    1509             return isolatedSession->sessionWithCredentialStorage;
     1520            return entry->sessionWithCredentialStorage;
    15101521        case WebCore::StoredCredentialsPolicy::DoNotUse:
    15111522            LOG(NetworkSession, "Using isolated NSURLSession without credential storage.");
    1512             return isolatedSession->sessionWithoutCredentialStorage;
     1523            return entry->sessionWithoutCredentialStorage;
    15131524        case WebCore::StoredCredentialsPolicy::EphemeralStateless:
    15141525            return initializeEphemeralStatelessSessionIfNeeded(isNavigatingToAppBoundDomain, session);
     
    15161527    } (storedCredentialsPolicy);
    15171528
    1518     if (addResult.isNewEntry) {
    1519         isolatedSessions.removeIf([&](auto& entry) {
    1520             return (now - entry.value->lastUsed) > 10_min;
    1521         });
    1522     }
     1529    if (isolatedSessions.size() > maxNumberOfIsolatedSessions) {
     1530        WebCore::RegistrableDomain keyToRemove;
     1531        auto oldestTimestamp = WallTime::now();
     1532        for (auto& key : isolatedSessions.keys()) {
     1533            auto timestamp = isolatedSessions.get(key)->lastUsed;
     1534            if (timestamp < oldestTimestamp) {
     1535                oldestTimestamp = timestamp;
     1536                keyToRemove = key;
     1537            }
     1538        }
     1539        LOG(NetworkSession, "About to remove isolated NSURLSession.");
     1540        isolatedSessions.remove(keyToRemove);
     1541    }
     1542
     1543    RELEASE_ASSERT(isolatedSessions.size() <= maxNumberOfIsolatedSessions);
    15231544
    15241545    return sessionWrapper;
Note: See TracChangeset for help on using the changeset viewer.