Changeset 265018 in webkit
- Timestamp:
- Jul 28, 2020 4:14:10 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r265015 r265018 1 2020-07-28 Kate Cheney <katherine_cheney@apple.com> 2 3 Migrate App-Bound Domains code from WebKit Additions 4 https://bugs.webkit.org/show_bug.cgi?id=214889 5 <rdar://problem/66075857> 6 7 Reviewed by Brent Fulgham. 8 9 * platform/ios-wk2/TestExpectations: 10 These tests are now expected to pass. 11 1 12 2020-07-28 Karl Rackler <rackler@apple.com> 2 13 -
trunk/LayoutTests/platform/ios-wk2/TestExpectations
r264943 r265018 1798 1798 1799 1799 webkit.org/b/214598 fast/scrolling/ios/autoscroll-input-when-very-zoomed.html [ Pass Failure ] 1800 1801 http/tests/in-app-browser-privacy/ [ Pass ] -
trunk/Source/WebKit/ChangeLog
r265009 r265018 1 2020-07-28 Kate Cheney <katherine_cheney@apple.com> 2 3 Migrate App-Bound Domains code from WebKit Additions 4 https://bugs.webkit.org/show_bug.cgi?id=214889 5 <rdar://problem/66075857> 6 7 Reviewed by Brent Fulgham. 8 9 No new tests, this is just code migration and will be tested 10 by existing App-Bound Domains tests. 11 12 * NetworkProcess/cocoa/NetworkSessionCocoa.mm: 13 (WebKit::activateSessionCleanup): 14 (WebKit::NetworkSessionCocoa::sessionWrapperForTask): 15 * Shared/Cocoa/DefaultWebBrowserChecks.h: Added. 16 * Shared/Cocoa/DefaultWebBrowserChecks.mm: Added. 17 Holds all functions related to full browser checks and 18 App-Bound Domains. 19 20 (WebKit::shouldBeTreatedAsFullBrowser): 21 (WebKit::getAppBoundDomainsTesting): 22 These functions allow us to treat our test runners as full browsers 23 while triggering non-browser mode for testing other App-Bound Domains 24 functionality. 25 26 (WebKit::isInWebKitChildProcess): 27 (WebKit::hasRequestedCrossWebsiteTrackingPermission): 28 (WebKit::determineITPStateInternal): 29 (WebKit::determineITPState): 30 (WebKit::doesAppHaveITPEnabled): 31 (WebKit::doesParentProcessHaveITPEnabled): 32 (WebKit::hasProhibitedUsageStrings): 33 (WebKit::isParentProcessAFullWebBrowser): 34 (WebKit::isFullWebBrowser): 35 * UIProcess/API/APIHTTPCookieStore.cpp: 36 (API::HTTPCookieStore::filterAppBoundCookies): 37 * UIProcess/API/APIPageConfiguration.cpp: 38 (API::PageConfiguration::PageConfiguration): 39 (): Deleted. 40 * UIProcess/WebPageProxy.cpp: 41 * UIProcess/WebProcessPool.cpp: 42 (WebKit::WebProcessPool::WebProcessPool): 43 (WebKit::WebProcessPool::ensureNetworkProcess): 44 (WebKit::WebProcessPool::createNewWebProcess): 45 * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: 46 (WebKit::WebsiteDataStore::addTestDomains const): 47 (WebKit::WebsiteDataStore::ensureAppBoundDomains const): 48 * UIProcess/WebsiteData/WebsiteDataStore.h: 49 * WebKit.xcodeproj/project.pbxproj: 50 1 51 2020-07-28 Tim Horton <timothy_horton@apple.com> 2 52 -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
r263904 r265018 30 30 #import "AuthenticationManager.h" 31 31 #import "DataReference.h" 32 #import "DefaultWebBrowserChecks.h" 32 33 #import "Download.h" 33 34 #import "LegacyCustomProtocolManager.h" … … 64 65 #else 65 66 #define NETWORK_SESSION_COCOA_ADDITIONS_1 66 #define NETWORK_SESSION_COCOA_ADDITIONS_2 true67 67 #endif 68 68 … … 1153 1153 } 1154 1154 1155 #if HAVE(SESSION_CLEANUP) 1156 static void activateSessionCleanup(NetworkSessionCocoa& session, const NetworkSessionCreationParameters& parameters) 1157 { 1158 #if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000) 1159 // Don't override an explicitly set value. 1160 if (parameters.resourceLoadStatisticsParameters.isItpStateExplicitlySet) 1161 return; 1162 1163 #if !PLATFORM(IOS_FAMILY_SIMULATOR) 1164 auto parentAuditToken = session.networkProcess().parentProcessConnection()->getAuditToken(); 1165 RELEASE_ASSERT(parentAuditToken); // This should be impossible. 1166 1167 bool itpEnabled = doesParentProcessHaveITPEnabled(parentAuditToken); 1168 bool passedEnabledState = session.isResourceLoadStatisticsEnabled(); 1169 1170 if (itpEnabled != passedEnabledState) 1171 WTFLogAlways("Passed ITP enabled state (%d) does not match TCC setting (%d)\n", itpEnabled, passedEnabledState); 1172 session.setResourceLoadStatisticsEnabled(passedEnabledState); 1173 #endif 1174 #endif 1175 } 1176 #endif 1177 1155 1178 NetworkSessionCocoa::NetworkSessionCocoa(NetworkProcess& networkProcess, NetworkSessionCreationParameters&& parameters) 1156 1179 : NetworkSession(networkProcess, parameters) … … 1293 1316 { 1294 1317 auto shouldBeConsideredAppBound = isNavigatingToAppBoundDomain ? *isNavigatingToAppBoundDomain : NavigatingToAppBoundDomain::Yes; 1295 if ( NETWORK_SESSION_COCOA_ADDITIONS_2)1318 if (isParentProcessAFullWebBrowser(networkProcess().parentProcessConnection()->getAuditToken())) 1296 1319 shouldBeConsideredAppBound = NavigatingToAppBoundDomain::No; 1297 1320 #if ENABLE(RESOURCE_LOAD_STATISTICS) -
trunk/Source/WebKit/UIProcess/API/APIHTTPCookieStore.cpp
r263551 r265018 27 27 #include "APIHTTPCookieStore.h" 28 28 29 #if PLATFORM(IOS_FAMILY) 30 #include "DefaultWebBrowserChecks.h" 31 #endif 32 29 33 #include "WebCookieManagerProxy.h" 30 34 #include "WebProcessPool.h" … … 36 40 #include <WebCore/NetworkStorageSession.h> 37 41 38 #if USE(APPLE_INTERNAL_SDK)39 #include <WebKitAdditions/HTTPCookieStoreAdditions.h>40 #else41 #define IMPLEMENT_IN_APP_BROWSER_PRIVACY_ENABLED false42 #endif43 44 42 using namespace WebKit; 45 43 … … 67 65 #if PLATFORM(IOS_FAMILY) 68 66 m_owningDataStore->getAppBoundDomains([cookies, appBoundCookies = WTFMove(appBoundCookies), completionHandler = WTFMove(completionHandler)] (auto& domains) mutable { 69 if (!domains.isEmpty() && IMPLEMENT_IN_APP_BROWSER_PRIVACY_ENABLED) {67 if (!domains.isEmpty() && !isFullWebBrowser()) { 70 68 for (auto& cookie : cookies) { 71 69 if (domains.contains(WebCore::RegistrableDomain::uncheckedCreateFromHost(cookie.domain))) -
trunk/Source/WebKit/UIProcess/API/APIPageConfiguration.cpp
r262066 r265018 36 36 #include "WebUserContentControllerProxy.h" 37 37 38 #if USE(APPLE_INTERNAL_SDK)39 #include <WebKitAdditions/PageConfigurationAdditions.h>40 #else41 #define PAGE_CONFIGURATION_ADDITIONS42 #endif43 44 38 #if ENABLE(APPLICATION_MANIFEST) 45 39 #include "APIApplicationManifest.h" … … 55 49 56 50 PageConfiguration::PageConfiguration() 57 PAGE_CONFIGURATION_ADDITIONS58 51 { 59 52 } -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r264961 r265018 289 289 #endif 290 290 291 #if USE(APPLE_INTERNAL_SDK) 292 #include <WebKitAdditions/WebPageProxyAdditions.h> 293 #else 294 static bool isFullWebBrowser() { return true; } 295 #if PLATFORM(IOS_FAMILY) 296 static bool hasProhibitedUsageStrings() { return false; } 297 #endif 291 #if PLATFORM(COCOA) 292 #include "DefaultWebBrowserChecks.h" 298 293 #endif 299 294 … … 1397 1392 RELEASE_LOG_IF_ALLOWED(Loading, "loadData:"); 1398 1393 1394 #if PLATFORM(IOS_FAMILY) 1399 1395 if (MIMEType == "text/html"_s && !isFullWebBrowser()) 1400 1396 m_limitsNavigationsToAppBoundDomains = true; 1397 #endif 1401 1398 1402 1399 if (m_isClosed) { -
trunk/Source/WebKit/UIProcess/WebProcessPool.cpp
r264874 r265018 127 127 128 128 #if PLATFORM(COCOA) 129 #include "DefaultWebBrowserChecks.h" 129 130 #include "VersionChecks.h" 130 131 #include <WebCore/GameControllerGamepadProvider.h> … … 140 141 #ifndef NDEBUG 141 142 #include <wtf/RefCountedLeakCounter.h> 142 #endif143 144 #if USE(APPLE_INTERNAL_SDK)145 #include <WebKitAdditions/WebProcessPoolAdditions.h>146 #else147 #define WEB_PROCESS_POOL_ADDITIONS148 #define WEB_PROCESS_POOL_ADDITIONS_2149 #define WEB_PROCESS_POOL_ADDITIONS_3150 #define WEB_PROCESS_POOL_ADDITIONS_4151 143 #endif 152 144 … … 256 248 , m_alwaysRunsAtBackgroundPriority(m_configuration->alwaysRunsAtBackgroundPriority()) 257 249 , m_shouldTakeUIBackgroundAssertion(m_configuration->shouldTakeUIBackgroundAssertion()) 258 WEB_PROCESS_POOL_ADDITIONS259 250 , m_userObservablePageCounter([this](RefCounterEvent) { updateProcessSuppressionState(); }) 260 251 , m_processSuppressionDisabledForPageCounter([this](RefCounterEvent) { updateProcessSuppressionState(); }) … … 272 263 WebCore::NetworkStorageSession::permitProcessToUseCookieAPI(true); 273 264 Process::setIdentifier(WebCore::ProcessIdentifier::generate()); 274 WEB_PROCESS_POOL_ADDITIONS_4 265 #if PLATFORM(COCOA) 266 determineITPState(); 267 #endif 275 268 }); 276 269 … … 614 607 HashSet<WebCore::RegistrableDomain> appBoundDomains; 615 608 WebCore::RegistrableDomain manualPrevalentResource; 616 WEB_PROCESS_POOL_ADDITIONS_2 609 610 #if PLATFORM(COCOA) 611 m_tccPreferenceEnabled = doesAppHaveITPEnabled(); 612 if (withWebsiteDataStore && !withWebsiteDataStore->isItpStateExplicitlySet()) { 613 enableResourceLoadStatistics = m_tccPreferenceEnabled; 614 withWebsiteDataStore->setResourceLoadStatisticsEnabled(enableResourceLoadStatistics); 615 } else if (m_websiteDataStore && !m_websiteDataStore->isItpStateExplicitlySet()) { 616 enableResourceLoadStatistics = m_tccPreferenceEnabled; 617 m_websiteDataStore->setResourceLoadStatisticsEnabled(enableResourceLoadStatistics); 618 } else if (WebsiteDataStore::defaultDataStoreExists() && !WebsiteDataStore::defaultDataStore()->isItpStateExplicitlySet()) { 619 enableResourceLoadStatistics = m_tccPreferenceEnabled; 620 WebsiteDataStore::defaultDataStore()->setResourceLoadStatisticsEnabled(enableResourceLoadStatistics); 621 } else 622 enableResourceLoadStatistics = m_tccPreferenceEnabled; 623 #endif 624 617 625 if (withWebsiteDataStore) { 618 626 enableResourceLoadStatistics = withWebsiteDataStore->resourceLoadStatisticsEnabled(); … … 885 893 WebProcessProxy& WebProcessPool::createNewWebProcess(WebsiteDataStore* websiteDataStore, WebProcessProxy::IsPrewarmed isPrewarmed) 886 894 { 887 WEB_PROCESS_POOL_ADDITIONS_3 895 #if PLATFORM(COCOA) 896 m_tccPreferenceEnabled = doesAppHaveITPEnabled(); 897 if (websiteDataStore && !websiteDataStore->isItpStateExplicitlySet()) 898 websiteDataStore->setResourceLoadStatisticsEnabled(m_tccPreferenceEnabled); 899 #endif 900 888 901 auto processProxy = WebProcessProxy::create(*this, websiteDataStore, isPrewarmed); 889 902 auto& process = processProxy.get(); -
trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm
r263874 r265018 28 28 29 29 #import "CookieStorageUtilsCF.h" 30 #import "DefaultWebBrowserChecks.h" 30 31 #import "SandboxUtilities.h" 31 32 #import "StorageManager.h" … … 46 47 #import <wtf/text/StringBuilder.h> 47 48 48 #if USE(APPLE_INTERNAL_SDK)49 #import <WebKitAdditions/WebsiteDataStoreAdditions.h>50 #else51 #define WEBSITE_DATA_STORE_ADDITIONS52 #endif53 54 49 #if PLATFORM(IOS_FAMILY) 55 50 #import <UIKit/UIApplication.h> … … 464 459 } 465 460 461 void WebsiteDataStore::addTestDomains() const 462 { 463 if (appBoundDomains().isEmpty()) { 464 auto bundleID = WebCore::applicationBundleIdentifier(); 465 auto appBoundDomainsTesting = getAppBoundDomainsTesting(bundleID); 466 if (appBoundDomainsTesting) { 467 for (auto& domain : *appBoundDomainsTesting) 468 appBoundDomains().add(domain); 469 } 470 } 471 } 472 466 473 void WebsiteDataStore::ensureAppBoundDomains(CompletionHandler<void(const HashSet<WebCore::RegistrableDomain>&, const HashSet<String>&)>&& completionHandler) const 467 474 { 468 475 if (hasInitializedAppBoundDomains) { 469 476 if (m_isInAppBrowserPrivacyTestModeEnabled) { 470 WEBSITE_DATA_STORE_ADDITIONS;477 addTestDomains(); 471 478 } 472 479 completionHandler(appBoundDomains(), appBoundSchemes()); … … 480 487 ASSERT(hasInitializedAppBoundDomains); 481 488 if (m_isInAppBrowserPrivacyTestModeEnabled) { 482 WEBSITE_DATA_STORE_ADDITIONS;489 addTestDomains(); 483 490 } 484 491 completionHandler(appBoundDomains(), appBoundSchemes()); -
trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h
r264613 r265018 313 313 enum class ForceReinitialization : bool { No, Yes }; 314 314 void initializeAppBoundDomains(ForceReinitialization = ForceReinitialization::No); 315 void addTestDomains() const; 315 316 316 317 void fetchDataAndApply(OptionSet<WebsiteDataType>, OptionSet<WebsiteDataFetchOption>, RefPtr<WorkQueue>&&, Function<void(Vector<WebsiteDataRecord>)>&& apply); -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r264957 r265018 964 964 49BCA19523A18CFD0028A836 /* _WKResourceLoadStatisticsFirstPartyInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 49BCA19023A175490028A836 /* _WKResourceLoadStatisticsFirstPartyInternal.h */; }; 965 965 49BCA19723A1930D0028A836 /* APIResourceLoadStatisticsThirdParty.h in Headers */ = {isa = PBXBuildFile; fileRef = 49BCA19623A18F620028A836 /* APIResourceLoadStatisticsThirdParty.h */; }; 966 49DAA38C24CBA1A800793D75 /* DefaultWebBrowserChecks.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49DAA38B24CBA1A800793D75 /* DefaultWebBrowserChecks.mm */; }; 966 967 49ECA41C23FCA5D80023358D /* PolicyDecision.h in Headers */ = {isa = PBXBuildFile; fileRef = 49ECA41B23FCA4860023358D /* PolicyDecision.h */; }; 967 968 49FBEFFD239B011D00BD032F /* _WKResourceLoadStatisticsFirstParty.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49FBEFFC239B011D00BD032F /* _WKResourceLoadStatisticsFirstParty.mm */; }; … … 3587 3588 49BCA19123A177660028A836 /* APIResourceLoadStatisticsFirstParty.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = APIResourceLoadStatisticsFirstParty.h; sourceTree = "<group>"; }; 3588 3589 49BCA19623A18F620028A836 /* APIResourceLoadStatisticsThirdParty.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = APIResourceLoadStatisticsThirdParty.h; sourceTree = "<group>"; }; 3590 49DAA38B24CBA1A800793D75 /* DefaultWebBrowserChecks.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = DefaultWebBrowserChecks.mm; sourceTree = "<group>"; }; 3591 49DAA38D24CBA1BD00793D75 /* DefaultWebBrowserChecks.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DefaultWebBrowserChecks.h; sourceTree = "<group>"; }; 3589 3592 49ECA41B23FCA4860023358D /* PolicyDecision.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PolicyDecision.h; sourceTree = "<group>"; }; 3590 3593 49FBEFFA239AD97800BD032F /* _WKResourceLoadStatisticsThirdParty.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _WKResourceLoadStatisticsThirdParty.h; sourceTree = "<group>"; }; … … 7484 7487 C55F916C1C595E440029E92D /* DataDetectionResult.h */, 7485 7488 C55F916D1C595E440029E92D /* DataDetectionResult.mm */, 7489 49DAA38D24CBA1BD00793D75 /* DefaultWebBrowserChecks.h */, 7490 49DAA38B24CBA1A800793D75 /* DefaultWebBrowserChecks.mm */, 7486 7491 CE550E132283744400D28791 /* InsertTextOptions.cpp */, 7487 7492 CE550E12228373C800D28791 /* InsertTextOptions.h */, … … 12731 12736 2D92A77E212B6A7100F493FD /* DataReference.cpp in Sources */, 12732 12737 2D92A77F212B6A7100F493FD /* Decoder.cpp in Sources */, 12738 49DAA38C24CBA1A800793D75 /* DefaultWebBrowserChecks.mm in Sources */, 12733 12739 2D0C56FE229F1DEA00BD33E7 /* DeviceManagementSoftLink.mm in Sources */, 12734 12740 1AB7D6191288B9D900CFD08C /* DownloadProxyMessageReceiver.cpp in Sources */, -
trunk/Tools/ChangeLog
r265017 r265018 1 2020-07-28 Kate Cheney <katherine_cheney@apple.com> 2 3 Migrate App-Bound Domains code from WebKit Additions 4 https://bugs.webkit.org/show_bug.cgi?id=214889 5 <rdar://problem/66075857> 6 7 Reviewed by Brent Fulgham. 8 9 Replace WebKit Additions macros with code to set a different bundle 10 identifier indicating that we want to run an App-Bound Domains test. 11 12 Remove #if USE(APPLE_INTERNAL_SDK) check so we run these tests on EWS. 13 14 * TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm: 15 (cleanUpInAppBrowserPrivacyTestSettings): 16 (initializeInAppBrowserPrivacyTestSettings): 17 1 18 2020-07-28 Aakash Jain <aakash_jain@apple.com> 2 19 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm
r263874 r265018 46 46 #if PLATFORM(IOS_FAMILY) 47 47 48 #if USE(APPLE_INTERNAL_SDK)49 #import <WebKitAdditions/InAppBrowserPrivacyTestAdditions.h>50 51 48 static bool isDone; 52 49 … … 132 129 { 133 130 WebCore::clearApplicationBundleIdentifierTestingOverride(); 134 IN_APP_BROWSER_PRIVACY_ADDITIONS_2131 WebCore::setApplicationBundleIdentifier("com.apple.WebKit.TestWebKitAPI"); 135 132 } 136 133 … … 139 136 WTF::initializeMainThread(); 140 137 WebCore::clearApplicationBundleIdentifierTestingOverride(); 141 IN_APP_BROWSER_PRIVACY_ADDITIONS138 WebCore::setApplicationBundleIdentifier("inAppBrowserPrivacyTestIdentifier"); 142 139 } 143 140 … … 1339 1336 } 1340 1337 1341 #endif // USE(APPLE_INTERNAL_SDK)1342 1343 1338 #endif // PLATFORM(IOS_FAMILY)
Note: See TracChangeset
for help on using the changeset viewer.