Changeset 229427 in webkit
- Timestamp:
- Mar 8, 2018, 1:11:50 PM (7 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r229426 r229427 1 2018-03-08 John Wilander <wilander@apple.com> 2 3 Resource Load Statistics: Make debug mode always partition prevalent resources 4 https://bugs.webkit.org/show_bug.cgi?id=183468 5 <rdar://problem/38269437> 6 7 Reviewed by Brent Fulgham. 8 9 After some testing we decided that a 30 second timeout in ITP debug mode just makes 10 it confusing. We should instead always partition prevalent resources in debug mode 11 to make it easy to understand. The partitioned state is what developers want to test 12 anyway. 13 14 * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm: 15 (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded): 16 Minor change to include 0 as valid setting. 17 * UIProcess/WebResourceLoadStatisticsStore.cpp: 18 (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode): 19 Now just stores the setting of debug mode instead of changing the timeout. 20 (WebKit::WebResourceLoadStatisticsStore::logUserInteraction): 21 Now does not disable partitioning under debug mode. 22 (WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies const): 23 Now returns true for prevalent resources with user interaction under debug mode. 24 (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning): 25 Removed duplicate debug logging statement. 26 * UIProcess/WebResourceLoadStatisticsStore.h: 27 Added member m_debugModeEnabled. 28 1 29 2018-03-08 Brent Fulgham <bfulgham@apple.com> 2 30 -
trunk/Source/WebKit/UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm
r228967 r229427 39 39 40 40 Seconds timeToLiveCookiePartitionFree([[NSUserDefaults standardUserDefaults] doubleForKey:@"ResourceLoadStatisticsTimeToLiveCookiePartitionFree"]); 41 if (timeToLiveCookiePartitionFree > 0_s && timeToLiveCookiePartitionFree <= 24_h)41 if (timeToLiveCookiePartitionFree >= 0_s && timeToLiveCookiePartitionFree <= 24_h) 42 42 setTimeToLiveCookiePartitionFree(timeToLiveCookiePartitionFree); 43 43 44 44 Seconds minimumTimeBetweenDataRecordsRemoval([[NSUserDefaults standardUserDefaults] doubleForKey:@"ResourceLoadStatisticsMinimumTimeBetweenDataRecordsRemoval"]); 45 if (minimumTimeBetweenDataRecordsRemoval > 0_s && minimumTimeBetweenDataRecordsRemoval < 1_h)45 if (minimumTimeBetweenDataRecordsRemoval >= 0_s && minimumTimeBetweenDataRecordsRemoval < 1_h) 46 46 setMinimumTimeBetweenDataRecordsRemoval(minimumTimeBetweenDataRecordsRemoval); 47 47 48 48 Seconds grandfatheringTime([[NSUserDefaults standardUserDefaults] doubleForKey:@"ResourceLoadStatisticsGrandfatheringTime"]); 49 if (grandfatheringTime > 0_s && grandfatheringTime <= 24_h * 7)49 if (grandfatheringTime >= 0_s && grandfatheringTime <= 24_h * 7) 50 50 setGrandfatheringTime(grandfatheringTime); 51 51 -
trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp
r229106 r229427 444 444 void WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode(bool enable) 445 445 { 446 if (enable)447 setTimeToLiveCookiePartitionFree(30_s); 448 else449 resetParametersToDefaultValues(); 446 m_debugModeEnabled = enable; 447 #if !RELEASE_LOG_DISABLED 448 RELEASE_LOG_INFO_IF(m_debugLoggingEnabled, ResourceLoadStatisticsDebug, "ITP Debug Mode %{public}s.", (m_debugModeEnabled ? "enabled" : "disabled")); 449 #endif 450 450 } 451 451 … … 460 460 statistics.mostRecentUserInteractionTime = WallTime::now(); 461 461 462 if (statistics.isMarkedForCookiePartitioning || statistics.isMarkedForCookieBlocking) 463 updateCookiePartitioningForDomains({ }, { }, { primaryDomain }, ShouldClearFirst::No, []() { }); 462 if (m_debugModeEnabled) { 463 if (statistics.isMarkedForCookieBlocking) 464 updateCookiePartitioningForDomains({ primaryDomain }, { }, { }, ShouldClearFirst::No, []() { }); 465 } else 466 if (statistics.isMarkedForCookiePartitioning || statistics.isMarkedForCookieBlocking) 467 updateCookiePartitioningForDomains({ }, { }, { primaryDomain }, ShouldClearFirst::No, []() { }); 464 468 }); 465 469 } … … 956 960 bool WebResourceLoadStatisticsStore::shouldPartitionCookies(const ResourceLoadStatistics& statistic) const 957 961 { 962 if (m_debugModeEnabled) 963 return statistic.isPrevalentResource && statistic.hadUserInteraction; 964 958 965 return statistic.isPrevalentResource && statistic.hadUserInteraction && WallTime::now() > statistic.mostRecentUserInteractionTime + m_parameters.timeToLiveCookiePartitionFree; 959 966 } … … 1004 1011 } 1005 1012 RELEASE_LOG_INFO(ResourceLoadStatisticsDebug, "About to partition cookies in third-party contexts for %{public}s.", domainsToPartitionBuilder.toString().utf8().data()); 1006 RELEASE_LOG_INFO(ResourceLoadStatisticsDebug, "About to partition cookies in third-party contexts for %s.", domainsToPartitionBuilder.toString().utf8().data());1007 1013 } 1008 1014 -
trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h
r229106 r229427 225 225 bool m_dataRecordsBeingRemoved { false }; 226 226 227 bool m_debugModeEnabled { false }; 227 228 bool m_debugLoggingEnabled { false }; 228 229
Note:
See TracChangeset
for help on using the changeset viewer.