Changeset 283274 in webkit
- Timestamp:
- Sep 29, 2021, 4:08:05 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 deleted
- 10 edited
- 1 copied
- 2 moved
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-expected.txt (deleted)
-
LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.py (deleted)
-
LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-without-interaction-expected.txt (moved) (moved from trunk/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-expected.txt ) (1 diff)
-
LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-without-interaction.py (moved) (moved from trunk/LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.py ) (3 diffs)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/fetch/connection-pool/network-partition-key-expected.txt (modified) (1 diff)
-
LayoutTests/platform/gtk/TestExpectations (modified) (1 diff)
-
LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/fetch/connection-pool (added)
-
LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/fetch/connection-pool/network-partition-key-expected.txt (copied) (copied from trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/connection-pool/network-partition-key-expected.txt )
-
LayoutTests/platform/wpe/TestExpectations (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/workers/service/server/SWServer.cpp (modified) (1 diff)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h (modified) (1 diff)
-
Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r283269 r283274 1 2021-09-29 Chris Dumez <cdumez@apple.com> 2 3 Use isolated NSURLSessions for each first party registrable domain 4 https://bugs.webkit.org/show_bug.cgi?id=230750 5 <rdar://83159358> 6 7 Reviewed by Alex Christensen. 8 9 This test is now passing more checks on WebKit2 but still completely fails on WebKit1 so I am 10 adding a WK1-specific baseline. 11 12 * platform/mac-wk1/imported/w3c/web-platform-tests/fetch/connection-pool/network-partition-key-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/fetch/connection-pool/network-partition-key-expected.txt. 13 1 14 2021-09-29 Aditya Keerthi <akeerthi@apple.com> 2 15 -
trunk/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-without-interaction-expected.txt
r283273 r283274 1 Tests that the session is switched upon top frame navigation to a prevalent resource with user interaction.1 Tests that the session is switched upon top frame navigation to a prevalent resource without user interaction. 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -
trunk/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-without-interaction.py
r283273 r283274 17 17 <body onload="runTest()"> 18 18 <script> 19 description("Tests that the session is notswitched 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 without user interaction."); 20 20 jsTestIsAsync = true; 21 21 … … 74 74 runTest(); 75 75 }); 76 break; 76 77 case "#step1": 77 78 setSessionCookie(); 78 79 setPersistentCookie(); 79 80 checkCookies(true, true); 80 if (testRunner.hasStatisticsIsolatedSession(prevalentOrigin)) { 81 testFailed("Origin has isolated session."); 81 if (testRunner.hasStatisticsIsolatedSession(prevalentOrigin)) 82 testPassed("Origin has isolated session."); 83 else { 84 testFailed("Origin has no isolated session."); 82 85 setEnableFeature(false, finishJSTest); 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"; 86 } 87 document.location.href = nonPrevalentOrigin + "/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-without-interaction.py#step2"; 86 88 break; 87 89 case "#step2": … … 98 100 break; 99 101 case "#step3": 100 document.location.href = prevalentOrigin + "/resourceLoadStatistics/ do-not-switch-session-on-navigation-to-prevalent-without-interaction.py#step4";102 document.location.href = prevalentOrigin + "/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-without-interaction.py#step4"; 101 103 break; 102 104 case "#step4": 103 105 checkCookies(true, true); 104 106 if (testRunner.hasStatisticsIsolatedSession(prevalentOrigin)) 105 test Failed("Origin has isolated session.");107 testPassed("Origin has isolated session."); 106 108 else 107 test Passed("Origin has no isolated session.");109 testFailed("Origin has no isolated session."); 108 110 setEnableFeature(false, finishJSTest); 109 111 break; -
trunk/LayoutTests/imported/w3c/ChangeLog
r283269 r283274 1 2021-09-29 Chris Dumez <cdumez@apple.com> 2 3 Use isolated NSURLSessions for each first party registrable domain 4 https://bugs.webkit.org/show_bug.cgi?id=230750 5 <rdar://83159358> 6 7 Reviewed by Alex Christensen. 8 9 Rebaseline WPT test that is now passing more checks. 10 11 * web-platform-tests/fetch/connection-pool/network-partition-key-expected.txt: 12 1 13 2021-09-29 Aditya Keerthi <akeerthi@apple.com> 2 14 -
trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/connection-pool/network-partition-key-expected.txt
r279344 r283274 1 1 2 2 3 FAIL With credentials promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\"" 4 FAIL Without credentials promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\"" 5 FAIL 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\"" 6 FAIL 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\"" 7 FAIL Iframes promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\"" 8 FAIL Workers promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\"" 9 FAIL 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\"" 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 10 10 FAIL CSP sandbox promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\"" 11 11 FAIL 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
r282847 r283274 896 896 897 897 webkit.org/b/209727 fast/forms/placeholder-content-line-height.html [ ImageOnlyFailure ] 898 899 webkit.org/b/210487 http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.py [ Failure ]900 898 901 899 webkit.org/b/210796 http/tests/resourceLoadStatistics/standalone-web-application-exempt-from-website-data-deletion.html [ Failure ] -
trunk/LayoutTests/platform/wpe/TestExpectations
r283094 r283274 598 598 webkit.org/b/210262 fast/selectors/text-field-selection-stroke-color.html [ ImageOnlyFailure ] 599 599 webkit.org/b/210262 fast/selectors/text-field-selection-text-shadow.html [ ImageOnlyFailure ] 600 601 webkit.org/b/210487 http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.py [ Failure ]602 600 603 601 webkit.org/b/211563 fast/text-indicator/text-indicator-estimated-color-with-implicit-newline.html [ Failure ] -
trunk/Source/WebCore/ChangeLog
r283273 r283274 1 2021-09-29 Chris Dumez <cdumez@apple.com> 2 3 Use isolated NSURLSessions for each first party registrable domain 4 https://bugs.webkit.org/show_bug.cgi?id=230750 5 <rdar://83159358> 6 7 Reviewed by Alex Christensen. 8 9 Fix bug where service worker soft-update requests would have their "first-party-for-cookies" 10 field set to "https:" instead of a full origin (e.g. "https://localhost:8080"). This was 11 causing some service worker test failures now that we use different NSURLSession based on 12 the "first-party-for-cookies" field. 13 14 * workers/service/server/SWServer.cpp: 15 (WebCore::originURL): 16 1 17 2021-09-29 Devin Rousso <drousso@apple.com> 2 18 -
trunk/Source/WebCore/workers/service/server/SWServer.cpp
r281854 r283274 441 441 URL static inline originURL(const SecurityOrigin& origin) 442 442 { 443 URL url; 444 url.setProtocol(origin.protocol()); 445 url.setHost(origin.host()); 446 url.setPort(origin.port()); 447 return url; 443 return URL(URL(), origin.data().toString()); 448 444 } 449 445 -
trunk/Source/WebKit/ChangeLog
r283271 r283274 1 2021-09-29 Chris Dumez <cdumez@apple.com> 2 3 Use isolated NSURLSessions for each first party registrable domain 4 https://bugs.webkit.org/show_bug.cgi?id=230750 5 <rdar://83159358> 6 7 Reviewed by Alex Christensen. 8 9 Previously would use up to 10 isolated NSURLSessions only for domains marked as prevalent 10 by ITP *and* that the user interacts with as first party website. We now use different 11 isolated NSURLSession for each top-level registrable domain, not matter their ITP status. 12 This significantly improves privacy. 13 14 To avoid having too many NSURLSession, we clear the ones that haven't been used in the 15 last 10 minutes, every time we add a new one. 16 17 * NetworkProcess/cocoa/NetworkSessionCocoa.h: 18 * NetworkProcess/cocoa/NetworkSessionCocoa.mm: 19 (WebKit::NetworkSessionCocoa::sessionWrapperForTask): 20 (WebKit::SessionSet::isolatedSession): 21 1 22 2021-09-29 Sihui Liu <sihui_liu@apple.com> 2 23 -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h
r279340 r283274 70 70 SessionWrapper sessionWithCredentialStorage; 71 71 SessionWrapper sessionWithoutCredentialStorage; 72 WallTime lastUsed;72 MonotonicTime lastUsed; 73 73 }; 74 74 -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
r282853 r283274 97 97 CFStringRef const WebKit2HTTPProxyDefaultsKey = static_cast<CFStringRef>(@"WebKit2HTTPProxy"); 98 98 CFStringRef const WebKit2HTTPSProxyDefaultsKey = static_cast<CFStringRef>(@"WebKit2HTTPSProxy"); 99 100 constexpr unsigned maxNumberOfIsolatedSessions { 10 };101 99 102 100 static NSURLSessionResponseDisposition toNSURLSessionResponseDisposition(WebCore::PolicyAction disposition) … … 1441 1439 if (isParentProcessAFullWebBrowser(networkProcess())) 1442 1440 shouldBeConsideredAppBound = NavigatingToAppBoundDomain::No; 1443 #if ENABLE(INTELLIGENT_TRACKING_PREVENTION)1444 if (auto* storageSession = networkStorageSession()) {1445 auto firstParty = WebCore::RegistrableDomain(request.firstPartyForCookies());1446 if (storageSession->shouldBlockThirdPartyCookiesButKeepFirstPartyCookiesFor(firstParty))1447 return sessionSetForPage(webPageProxyID).isolatedSession(storedCredentialsPolicy, firstParty, shouldBeConsideredAppBound, *this);1448 } else1449 ASSERT_NOT_REACHED();1450 #endif1451 1441 1452 1442 #if ENABLE(APP_BOUND_DOMAINS) … … 1455 1445 #endif 1456 1446 1457 switch (storedCredentialsPolicy) { 1458 case WebCore::StoredCredentialsPolicy::Use: 1459 return sessionSetForPage(webPageProxyID).sessionWithCredentialStorage; 1460 case WebCore::StoredCredentialsPolicy::DoNotUse: 1461 return sessionSetForPage(webPageProxyID).sessionWithoutCredentialStorage; 1462 case WebCore::StoredCredentialsPolicy::EphemeralStateless: 1463 return initializeEphemeralStatelessSessionIfNeeded(webPageProxyID, NavigatingToAppBoundDomain::No); 1464 } 1447 auto firstParty = WebCore::RegistrableDomain(request.firstPartyForCookies()); 1448 if (firstParty.isEmpty()) 1449 firstParty = WebCore::RegistrableDomain(request.url()); 1450 1451 return sessionSetForPage(webPageProxyID).isolatedSession(storedCredentialsPolicy, firstParty, shouldBeConsideredAppBound, *this); 1465 1452 } 1466 1453 … … 1519 1506 SessionWrapper& SessionSet::isolatedSession(WebCore::StoredCredentialsPolicy storedCredentialsPolicy, const WebCore::RegistrableDomain firstPartyDomain, NavigatingToAppBoundDomain isNavigatingToAppBoundDomain, NetworkSessionCocoa& session) 1520 1507 { 1521 auto & entry= isolatedSessions.ensure(firstPartyDomain, [this, &session, isNavigatingToAppBoundDomain] {1508 auto addResult = isolatedSessions.ensure(firstPartyDomain, [this, &session, isNavigatingToAppBoundDomain] { 1522 1509 auto newEntry = makeUnique<IsolatedSession>(); 1523 1510 newEntry->sessionWithCredentialStorage.initialize(sessionWithCredentialStorage.session.get().configuration, session, WebCore::StoredCredentialsPolicy::Use, isNavigatingToAppBoundDomain); 1524 1511 newEntry->sessionWithoutCredentialStorage.initialize(sessionWithoutCredentialStorage.session.get().configuration, session, WebCore::StoredCredentialsPolicy::DoNotUse, isNavigatingToAppBoundDomain); 1525 1512 return newEntry; 1526 }).iterator->value; 1527 1528 entry->lastUsed = WallTime::now(); 1513 }); 1514 1515 auto now = MonotonicTime::now(); 1516 auto& isolatedSession = addResult.iterator->value; 1517 isolatedSession->lastUsed = now; 1529 1518 1530 1519 auto& sessionWrapper = [&] (auto storedCredentialsPolicy) -> SessionWrapper& { … … 1532 1521 case WebCore::StoredCredentialsPolicy::Use: 1533 1522 LOG(NetworkSession, "Using isolated NSURLSession with credential storage."); 1534 return entry->sessionWithCredentialStorage;1523 return isolatedSession->sessionWithCredentialStorage; 1535 1524 case WebCore::StoredCredentialsPolicy::DoNotUse: 1536 1525 LOG(NetworkSession, "Using isolated NSURLSession without credential storage."); 1537 return entry->sessionWithoutCredentialStorage;1526 return isolatedSession->sessionWithoutCredentialStorage; 1538 1527 case WebCore::StoredCredentialsPolicy::EphemeralStateless: 1539 1528 return initializeEphemeralStatelessSessionIfNeeded(isNavigatingToAppBoundDomain, session); … … 1541 1530 } (storedCredentialsPolicy); 1542 1531 1543 if (isolatedSessions.size() > maxNumberOfIsolatedSessions) { 1544 WebCore::RegistrableDomain keyToRemove; 1545 auto oldestTimestamp = WallTime::now(); 1546 for (auto& key : isolatedSessions.keys()) { 1547 auto timestamp = isolatedSessions.get(key)->lastUsed; 1548 if (timestamp < oldestTimestamp) { 1549 oldestTimestamp = timestamp; 1550 keyToRemove = key; 1551 } 1552 } 1553 LOG(NetworkSession, "About to remove isolated NSURLSession."); 1554 isolatedSessions.remove(keyToRemove); 1555 } 1556 1557 RELEASE_ASSERT(isolatedSessions.size() <= maxNumberOfIsolatedSessions); 1532 if (addResult.isNewEntry) { 1533 isolatedSessions.removeIf([&](auto& entry) { 1534 return (now - entry.value->lastUsed) > 10_min; 1535 }); 1536 } 1558 1537 1559 1538 return sessionWrapper;
Note:
See TracChangeset
for help on using the changeset viewer.