Changeset 257758 in webkit
- Timestamp:
- Mar 2, 2020, 7:11:06 PM (7 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 15 edited
-
ChangeLog (modified) (1 diff)
-
NetworkProcess/NetworkSessionCreationParameters.cpp (modified) (4 diffs)
-
NetworkProcess/NetworkSessionCreationParameters.h (modified) (2 diffs)
-
NetworkProcess/cocoa/NetworkSessionCocoa.mm (modified) (2 diffs)
-
NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in (modified) (1 diff)
-
Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb (modified) (1 diff)
-
Scripts/process-entitlements.sh (modified) (3 diffs)
-
UIProcess/API/C/WKWebsiteDataStoreRef.cpp (modified) (1 diff)
-
UIProcess/API/Cocoa/WKWebsiteDataStore.mm (modified) (1 diff)
-
UIProcess/Cocoa/VersionChecks.h (modified) (4 diffs)
-
UIProcess/WebProcessPool.cpp (modified) (5 diffs)
-
UIProcess/WebProcessPool.h (modified) (2 diffs)
-
UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm (modified) (2 diffs)
-
UIProcess/WebsiteData/WebsiteDataStore.cpp (modified) (2 diffs)
-
UIProcess/WebsiteData/WebsiteDataStore.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r257755 r257758 1 2020-03-02 Brent Fulgham <bfulgham@apple.com> 2 3 Add flag to indicate that ITP state was explicitly set 4 https://bugs.webkit.org/show_bug.cgi?id=208461 5 <rdar://problem/59960829> 6 7 Reviewed by John Wilander. 8 9 Now that ITP is supported in Ephemeral sessions, we would like to move to a process-wide 10 concept of ITP being on or off, rather than controlling this at a website data level. 11 This patch takes the first step by adding a flag to the WebKit::NetworkSessionCreationParameters 12 structure that tracks whether the state of ITP (On or Off) was explicitly set by 13 SPI (primarily during testing). 14 15 This patch also ensures that we can communicate with TCC for the purpose of checking if 16 ITP is on or off. 17 18 * NetworkProcess/NetworkSessionCreationParameters.cpp: 19 (WebKit::NetworkSessionCreationParameters::encode const): 20 (WebKit::NetworkSessionCreationParameters::decode): 21 * NetworkProcess/NetworkSessionCreationParameters.h: 22 * NetworkProcess/cocoa/NetworkSessionCocoa.mm: 23 (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): 24 * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: 25 * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: 26 * Scripts/process-entitlements.sh: 27 * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: 28 (WKWebsiteDataStoreSetResourceLoadStatisticsEnabled): 29 * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: 30 (-[WKWebsiteDataStore _setResourceLoadStatisticsEnabled:]): 31 * UIProcess/Cocoa/VersionChecks.h: 32 * UIProcess/WebProcessPool.cpp: 33 (WebKit::WebProcessPool::WebProcessPool): 34 (WebKit::WebProcessPool::ensureNetworkProcess): 35 (WebKit::WebProcessPool::createNewWebProcess): 36 * UIProcess/WebProcessPool.h: 37 * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: 38 (WebKit::WebsiteDataStore::parameters): 39 * UIProcess/WebsiteData/WebsiteDataStore.cpp: 40 (WebKit::WebsiteDataStore::setIsRunningResourceLoadStatisticsTest): 41 * UIProcess/WebsiteData/WebsiteDataStore.h: 42 (WebKit::WebsiteDataStore::itpStateWasExplicitlySet const): 43 (WebKit::WebsiteDataStore::useExplicitITPState): 44 1 45 2020-03-02 Alan Coon <alancoon@apple.com> 2 46 -
trunk/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.cpp
r257185 r257758 1 1 /* 2 * Copyright (C) 2018 Apple Inc. All rights reserved.2 * Copyright (C) 2018-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 64 64 encoder << resourceLoadStatisticsDirectoryExtensionHandle; 65 65 encoder << enableResourceLoadStatistics; 66 encoder << isItpStateExplicitlySet; 66 67 encoder << enableResourceLoadStatisticsLogTestingEvent; 67 68 encoder << shouldIncludeLocalhostInResourceLoadStatistics; … … 180 181 return WTF::nullopt; 181 182 183 Optional<bool> isItpStateExplicitlySet; 184 decoder >> isItpStateExplicitlySet; 185 if (!isItpStateExplicitlySet) 186 return WTF::nullopt; 187 182 188 Optional<bool> enableResourceLoadStatisticsLogTestingEvent; 183 189 decoder >> enableResourceLoadStatisticsLogTestingEvent; … … 301 307 , WTFMove(*resourceLoadStatisticsDirectoryExtensionHandle) 302 308 , WTFMove(*enableResourceLoadStatistics) 309 , WTFMove(*isItpStateExplicitlySet) 303 310 , WTFMove(*enableResourceLoadStatisticsLogTestingEvent) 304 311 , WTFMove(*shouldIncludeLocalhostInResourceLoadStatistics) -
trunk/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h
r257185 r257758 1 1 /* 2 * Copyright (C) 2017 Apple Inc. All rights reserved.2 * Copyright (C) 2017-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 83 83 SandboxExtension::Handle resourceLoadStatisticsDirectoryExtensionHandle; 84 84 bool enableResourceLoadStatistics { false }; 85 bool isItpStateExplicitlySet { false }; 85 86 bool enableResourceLoadStatisticsLogTestingEvent { false }; 86 87 bool shouldIncludeLocalhostInResourceLoadStatistics { true }; -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
r257185 r257758 1 1 /* 2 * Copyright (C) 2015-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2015-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 1162 1162 1163 1163 #if HAVE(SESSION_CLEANUP) 1164 activateSessionCleanup(*this );1164 activateSessionCleanup(*this, parameters); 1165 1165 #endif 1166 1166 } -
trunk/Source/WebKit/NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in
r257162 r257758 441 441 (global-name "com.apple.ProgressReporting")) 442 442 443 ;; Needed for TCC. 444 (allow mach-lookup 445 (global-name "com.apple.tccd")) -
trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb
r257643 r257758 675 675 (allow iokit-get-properties 676 676 (iokit-property "IORegistryEntryPropertyKeys")) 677 678 ;; Needed for TCC. 679 (allow mach-lookup 680 (global-name "com.apple.tccd")) -
trunk/Source/WebKit/Scripts/process-entitlements.sh
r257386 r257758 44 44 then 45 45 plistbuddy Add :com.apple.private.network.socket-delegate bool YES 46 fi 47 48 if (( "${TARGET_MAC_OS_X_VERSION_MAJOR}" >= 101600 )) 49 then 50 plistbuddy Add :com.apple.private.tcc.manager.check-by-audit-token array 51 plistbuddy Add :com.apple.private.tcc.manager.check-by-audit-token:0 string kTCCServiceWebKitIntelligentTrackingPrevention 46 52 fi 47 53 … … 102 108 plistbuddy Add :com.apple.private.network.socket-delegate bool YES 103 109 plistbuddy Add :com.apple.security.network.client bool YES 110 111 plistbuddy Add :com.apple.private.tcc.manager.check-by-audit-token array 112 plistbuddy Add :com.apple.private.tcc.manager.check-by-audit-token:0 string kTCCServiceWebKitIntelligentTrackingPrevention 104 113 } 105 114 … … 169 178 plistbuddy Add :com.apple.private.network.socket-delegate bool YES 170 179 180 plistbuddy Add :com.apple.private.tcc.manager.check-by-audit-token array 181 plistbuddy Add :com.apple.private.tcc.manager.check-by-audit-token:0 string kTCCServiceWebKitIntelligentTrackingPrevention 182 171 183 plistbuddy Add :seatbelt-profiles array 172 184 plistbuddy Add :seatbelt-profiles:0 string com.apple.WebKit.Networking -
trunk/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp
r257726 r257758 69 69 void WKWebsiteDataStoreSetResourceLoadStatisticsEnabled(WKWebsiteDataStoreRef dataStoreRef, bool enable) 70 70 { 71 WebKit::toImpl(dataStoreRef)->setResourceLoadStatisticsEnabled(enable); 71 auto* websiteDataStore = WebKit::toImpl(dataStoreRef); 72 #if ENABLE(RESOURCE_LOAD_STATISTICS) 73 websiteDataStore->useExplicitITPState(); 74 #endif 75 websiteDataStore->setResourceLoadStatisticsEnabled(enable); 72 76 } 73 77 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm
r257553 r257758 279 279 - (void)_setResourceLoadStatisticsEnabled:(BOOL)enabled 280 280 { 281 _websiteDataStore->useExplicitITPState(); 281 282 _websiteDataStore->setResourceLoadStatisticsEnabled(enabled); 282 283 } -
trunk/Source/WebKit/UIProcess/Cocoa/VersionChecks.h
r256191 r257758 47 47 #define DYLD_IOS_VERSION_FIRST_WITH_DEVICE_ORIENTATION_AND_MOTION_PERMISSION_API 0 48 48 #endif 49 50 #ifndef DYLD_IOS_VERSION_FIRST_WITH_SESSION_CLEANUP_BY_DEFAULT 51 #define DYLD_IOS_VERSION_FIRST_WITH_SESSION_CLEANUP_BY_DEFAULT 0 52 #endif 53 49 54 #endif // PLATFORM(IOS_FAMILY) 50 55 … … 53 58 #define DYLD_MACOS_VERSION_FIRST_WITH_EXCEPTIONS_FOR_RELATED_WEBVIEWS_USING_DIFFERENT_DATA_STORES 0 54 59 #endif 60 61 #ifndef DYLD_MACOS_VERSION_FIRST_WITH_SESSION_CLEANUP_BY_DEFAULT 62 #define DYLD_MACOS_VERSION_FIRST_WITH_SESSION_CLEANUP_BY_DEFAULT 0 55 63 #endif 56 64 65 #endif // PLATFORM(MAC) 57 66 58 67 … … 83 92 FirstWhereSiteSpecificQuirksAreEnabledByDefault = DYLD_IOS_VERSION_13_2, 84 93 FirstThatRestrictsBaseURLSchemes = DYLD_IOS_VERSION_13_4, 94 FirstWithSessionCleanupByDefault = DYLD_IOS_VERSION_FIRST_WITH_SESSION_CLEANUP_BY_DEFAULT, 85 95 #elif PLATFORM(MAC) 86 96 FirstWithNetworkCache = DYLD_MACOSX_VERSION_10_11, … … 94 104 FirstWhereSiteSpecificQuirksAreEnabledByDefault = DYLD_MACOSX_VERSION_10_15_1, 95 105 FirstThatRestrictsBaseURLSchemes = DYLD_MACOSX_VERSION_10_15_4, 106 FirstWithSessionCleanupByDefault = DYLD_MACOS_VERSION_FIRST_WITH_SESSION_CLEANUP_BY_DEFAULT, 96 107 #endif 97 108 }; -
trunk/Source/WebKit/UIProcess/WebProcessPool.cpp
r257675 r257758 1 1 /* 2 * Copyright (C) 2010-20 18Apple Inc. All rights reserved.2 * Copyright (C) 2010-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 137 137 #endif 138 138 139 #if USE(APPLE_INTERNAL_SDK) 140 #include <WebKitAdditions/WebProcessPoolAdditions.h> 141 #else 142 #define WEB_PROCESS_POOL_ADDITIONS 143 #define WEB_PROCESS_POOL_ADDITIONS_2 144 #define WEB_PROCESS_POOL_ADDITIONS_3 145 #endif 146 139 147 #define WEBPROCESSPOOL_RELEASE_LOG(channel, fmt, ...) RELEASE_LOG(channel, "%p - WebProcessPool::" fmt, this, ##__VA_ARGS__) 140 148 #define WEBPROCESSPOOL_RELEASE_LOG_ERROR(channel, fmt, ...) RELEASE_LOG_ERROR(channel, "%p - WebProcessPool::" fmt, this, ##__VA_ARGS__) … … 242 250 , m_alwaysRunsAtBackgroundPriority(m_configuration->alwaysRunsAtBackgroundPriority()) 243 251 , m_shouldTakeUIBackgroundAssertion(m_configuration->shouldTakeUIBackgroundAssertion()) 252 WEB_PROCESS_POOL_ADDITIONS 244 253 , m_userObservablePageCounter([this](RefCounterEvent) { updateProcessSuppressionState(); }) 245 254 , m_processSuppressionDisabledForPageCounter([this](RefCounterEvent) { updateProcessSuppressionState(); }) … … 586 595 WebCore::FirstPartyWebsiteDataRemovalMode firstPartyWebsiteDataRemovalMode = WebCore::FirstPartyWebsiteDataRemovalMode::AllButCookies; 587 596 WebCore::RegistrableDomain manualPrevalentResource { }; 597 WEB_PROCESS_POOL_ADDITIONS_2 588 598 if (withWebsiteDataStore) { 589 599 enableResourceLoadStatistics = withWebsiteDataStore->resourceLoadStatisticsEnabled(); … … 833 843 WebProcessProxy& WebProcessPool::createNewWebProcess(WebsiteDataStore* websiteDataStore, WebProcessProxy::IsPrewarmed isPrewarmed) 834 844 { 845 WEB_PROCESS_POOL_ADDITIONS_3 835 846 auto processProxy = WebProcessProxy::create(*this, websiteDataStore, isPrewarmed); 836 847 auto& process = processProxy.get(); -
trunk/Source/WebKit/UIProcess/WebProcessPool.h
r257610 r257758 1 1 /* 2 * Copyright (C) 2010-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2010-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 729 729 bool m_shouldMakeNextWebProcessLaunchFailForTesting { false }; 730 730 bool m_shouldMakeNextNetworkProcessLaunchFailForTesting { false }; 731 bool m_tccPreferenceEnabled { false }; 731 732 732 733 UserObservablePageCounter m_userObservablePageCounter; -
trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm
r257553 r257758 1 1 /* 2 * Copyright (C) 2015-20 18Apple Inc. All rights reserved.2 * Copyright (C) 2015-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 163 163 WTFMove(resourceLoadStatisticsDirectoryHandle), 164 164 resourceLoadStatisticsEnabled(), 165 isItpStateExplicitlySet(), 165 166 hasStatisticsTestingCallback(), 166 167 shouldIncludeLocalhostInResourceLoadStatistics, -
trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
r257726 r257758 1 1 /* 2 * Copyright (C) 2014-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2014-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 1600 1600 void WebsiteDataStore::setIsRunningResourceLoadStatisticsTest(bool value, CompletionHandler<void()>&& completionHandler) 1601 1601 { 1602 useExplicitITPState(); 1602 1603 auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); 1603 1604 -
trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h
r257726 r257758 1 1 /* 2 * Copyright (C) 2014-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2014-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 197 197 void setResourceLoadStatisticsFirstPartyWebsiteDataRemovalModeForTesting(bool enabled, CompletionHandler<void()>&&); 198 198 WebCore::ThirdPartyCookieBlockingMode thirdPartyCookieBlockingMode() const; 199 bool isItpStateExplicitlySet() const { return m_isItpStateExplicitlySet; } 200 void useExplicitITPState() { m_isItpStateExplicitlySet = true; } 199 201 #endif 200 202 void setCacheMaxAgeCapForPrevalentResources(Seconds, CompletionHandler<void()>&&); … … 338 340 WeakHashSet<WebProcessProxy> m_processes; 339 341 342 bool m_isItpStateExplicitlySet { false }; 343 340 344 #if HAVE(SEC_KEY_PROXY) 341 345 Vector<Ref<SecKeyProxyStore>> m_secKeyProxyStores;
Note:
See TracChangeset
for help on using the changeset viewer.