Changeset 220412 in webkit
- Timestamp:
- Aug 8, 2017 10:18:24 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r220410 r220412 1 2017-08-08 John Wilander <wilander@apple.com> 2 3 Resource Load Statistics: Clear web processes' state on history removal 4 https://bugs.webkit.org/show_bug.cgi?id=175271 5 <rdar://problem/33756560> 6 7 Reviewed by Chris Dumez. 8 9 * http/tests/loading/resourceLoadStatistics/user-interaction-reported-after-website-data-removal-expected.txt: Added. 10 * http/tests/loading/resourceLoadStatistics/user-interaction-reported-after-website-data-removal.html: Added. 11 * platform/mac-wk2/TestExpectations: 12 user-interaction-reported-after-website-data-removal.html marked as [ Pass ]. 13 1 14 2017-08-08 Ryan Haddad <ryanhaddad@apple.com> 2 15 -
trunk/LayoutTests/platform/mac-wk2/TestExpectations
r220375 r220412 732 732 http/tests/loading/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame.html [ Pass ] 733 733 http/tests/loading/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time.html [ Pass ] 734 http/tests/loading/resourceLoadStatistics/user-interaction-reported-after-website-data-removal.html [ Pass ] 734 735 735 736 webkit.org/b/173861 [ Release ] http/tests/webrtc/filtering-ice-candidate-same-origin-frame.html [ Pass Timeout ] -
trunk/Source/WebKit/ChangeLog
r220408 r220412 1 2017-08-08 John Wilander <wilander@apple.com> 2 3 Resource Load Statistics: Clear web processes' state on history removal 4 https://bugs.webkit.org/show_bug.cgi?id=175271 5 <rdar://problem/33756560> 6 7 Reviewed by Chris Dumez. 8 9 https://bugs.webkit.org/show_bug.cgi?id=175090 introduced state 10 in the web process and that state needs to be cleared when the 11 UI process' statistics are cleared as part of history removal. 12 13 * UIProcess/WebProcessPool.cpp: 14 (WebKit::WebProcessPool::clearResourceLoadStatistics): 15 * UIProcess/WebProcessPool.h: 16 * UIProcess/WebsiteData/WebsiteDataStore.cpp: 17 (WebKit::WebsiteDataStore::removeData): 18 (WebKit::WebsiteDataStore::clearResourceLoadStatisticsInWebProcesses): 19 * UIProcess/WebsiteData/WebsiteDataStore.h: 20 * WebProcess/WebProcess.cpp: 21 (WebKit::WebProcess::clearResourceLoadStatistics): 22 * WebProcess/WebProcess.h: 23 * WebProcess/WebProcess.messages.in: 24 1 25 2017-08-08 Adrian Perez de Castro <aperez@igalia.com> 2 26 -
trunk/Source/WebKit/UIProcess/WebProcessPool.cpp
r220105 r220412 1100 1100 } 1101 1101 1102 void WebProcessPool::clearResourceLoadStatistics() 1103 { 1104 sendToAllProcesses(Messages::WebProcess::ClearResourceLoadStatistics()); 1105 } 1106 1102 1107 void WebProcessPool::registerURLSchemeAsEmptyDocument(const String& urlScheme) 1103 1108 { -
trunk/Source/WebKit/UIProcess/WebProcessPool.h
r220105 r220412 389 389 bool resourceLoadStatisticsEnabled() { return m_resourceLoadStatisticsEnabled; } 390 390 void setResourceLoadStatisticsEnabled(bool); 391 void clearResourceLoadStatistics(); 391 392 392 393 bool alwaysRunsAtBackgroundPriority() const { return m_alwaysRunsAtBackgroundPriority; } -
trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
r220105 r220412 822 822 else 823 823 m_resourceLoadStatistics->scheduleClearInMemoryAndPersistent(modifiedSince, WebResourceLoadStatisticsStore::ShouldGrandfather::Yes); 824 825 clearResourceLoadStatisticsInWebProcesses(); 824 826 } 825 827 … … 1100 1102 else 1101 1103 m_resourceLoadStatistics->scheduleClearInMemoryAndPersistent(WebResourceLoadStatisticsStore::ShouldGrandfather::Yes); 1104 1105 clearResourceLoadStatisticsInWebProcesses(); 1102 1106 } 1103 1107 … … 1316 1320 } 1317 1321 1322 void WebsiteDataStore::clearResourceLoadStatisticsInWebProcesses() 1323 { 1324 if (!resourceLoadStatisticsEnabled()) 1325 return; 1326 1327 for (auto& processPool : processPools()) 1328 processPool->clearResourceLoadStatistics(); 1329 } 1330 1318 1331 StorageProcessCreationParameters WebsiteDataStore::storageProcessParameters() 1319 1332 { -
trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h
r220243 r220412 93 93 void setResourceLoadStatisticsEnabled(bool); 94 94 WebResourceLoadStatisticsStore* resourceLoadStatistics() const { return m_resourceLoadStatistics.get(); } 95 void clearResourceLoadStatisticsInWebProcesses(); 95 96 96 97 static void cloneSessionData(WebPageProxy& sourcePage, WebPageProxy& newPage); -
trunk/Source/WebKit/WebProcess/WebProcess.cpp
r220404 r220412 1452 1452 } 1453 1453 1454 void WebProcess::clearResourceLoadStatistics() 1455 { 1456 ResourceLoadObserver::shared().clearState(); 1457 } 1458 1454 1459 RefPtr<API::Object> WebProcess::transformHandlesToObjects(API::Object* object) 1455 1460 { -
trunk/Source/WebKit/WebProcess/WebProcess.h
r220105 r220412 256 256 void setShouldUseFontSmoothing(bool); 257 257 void setResourceLoadStatisticsEnabled(bool); 258 void clearResourceLoadStatistics(); 258 259 void userPreferredLanguagesChanged(const Vector<String>&) const; 259 260 void fullKeyboardAccessModeChanged(bool fullKeyboardAccessEnabled); -
trunk/Source/WebKit/WebProcess/WebProcess.messages.in
r218419 r220412 42 42 SetShouldUseFontSmoothing(bool useFontSmoothing) 43 43 SetResourceLoadStatisticsEnabled(bool resourceLoadStatisticsEnabled); 44 ClearResourceLoadStatistics(); 44 45 UserPreferredLanguagesChanged(Vector<String> languages) 45 46 FullKeyboardAccessModeChanged(bool fullKeyboardAccessEnabled) -
trunk/Tools/ChangeLog
r220407 r220412 1 2017-08-08 John Wilander <wilander@apple.com> 2 3 Resource Load Statistics: Clear web processes' state on history removal 4 https://bugs.webkit.org/show_bug.cgi?id=175271 5 <rdar://problem/33756560> 6 7 Reviewed by Chris Dumez. 8 9 Test infrastructure for asynchronous tests of website data 10 removal for _WKWebsiteDataTypeResourceLoadStatistics. 11 12 * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: 13 * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: 14 (WTR::InjectedBundle::didReceiveMessageToPage): 15 * WebKitTestRunner/InjectedBundle/TestRunner.cpp: 16 (WTR::TestRunner::statisticsClearThroughWebsiteDataRemoval): 17 (WTR::TestRunner::statisticsCallClearThroughWebsiteDataRemovalCallback): 18 * WebKitTestRunner/InjectedBundle/TestRunner.h: 19 * WebKitTestRunner/TestController.cpp: 20 (WTR::TestController::statisticsClearThroughWebsiteDataRemoval): 21 * WebKitTestRunner/TestController.h: 22 * WebKitTestRunner/TestInvocation.cpp: 23 (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle): 24 (WTR::TestInvocation::didClearStatisticsThroughWebsiteDataRemoval): 25 * WebKitTestRunner/TestInvocation.h: 26 * WebKitTestRunner/cocoa/TestControllerCocoa.mm: 27 (WTR::TestController::statisticsClearThroughWebsiteDataRemoval): 28 1 29 2017-08-08 Alicia Boya García <aboya@igalia.com> 2 30 -
trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
r219319 r220412 280 280 void statisticsClearInMemoryAndPersistentStore(); 281 281 void statisticsClearInMemoryAndPersistentStoreModifiedSinceHours(unsigned long hours); 282 void statisticsClearThroughWebsiteDataRemoval(object callback); 282 283 void statisticsResetToConsistentState(); 283 284 -
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
r220311 r220412 241 241 } 242 242 243 if (WKStringIsEqualToUTF8CString(messageName, "CallDidClearStatisticsThroughWebsiteDataRemoval")) { 244 m_testRunner->statisticsCallClearThroughWebsiteDataRemovalCallback(); 245 return; 246 } 247 243 248 if (WKStringIsEqualToUTF8CString(messageName, "CallDidRemoveAllSessionCredentialsCallback")) { 244 249 m_testRunner->callDidRemoveAllSessionCredentialsCallback(); -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
r220403 r220412 646 646 StatisticsDidScanDataRecordsCallbackID, 647 647 StatisticsDidRunTelemetryCallbackID, 648 StatisticsDidClearThroughWebsiteDataRemovalCallbackID, 648 649 DidRemoveAllSessionCredentialsCallbackID, 649 650 FirstUIScriptCallbackID = 100 … … 1553 1554 } 1554 1555 1556 void TestRunner::statisticsClearThroughWebsiteDataRemoval(JSValueRef callback) 1557 { 1558 cacheTestRunnerCallback(StatisticsDidClearThroughWebsiteDataRemovalCallbackID, callback); 1559 1560 WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("StatisticsClearThroughWebsiteDataRemoval")); 1561 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), 0, nullptr); 1562 } 1563 1564 void TestRunner::statisticsCallClearThroughWebsiteDataRemovalCallback() 1565 { 1566 callTestRunnerCallback(StatisticsDidClearThroughWebsiteDataRemovalCallbackID); 1567 } 1568 1555 1569 void TestRunner::statisticsResetToConsistentState() 1556 1570 { -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
r220311 r220412 380 380 void statisticsClearInMemoryAndPersistentStore(); 381 381 void statisticsClearInMemoryAndPersistentStoreModifiedSinceHours(unsigned hours); 382 void statisticsClearThroughWebsiteDataRemoval(JSValueRef callback); 383 void statisticsCallClearThroughWebsiteDataRemovalCallback(); 382 384 void statisticsResetToConsistentState(); 383 385 -
trunk/Tools/WebKitTestRunner/TestController.cpp
r220370 r220412 2358 2358 } 2359 2359 2360 void TestController::statisticsClearThroughWebsiteDataRemoval() 2361 { 2362 } 2363 2360 2364 void TestController::statisticsResetToConsistentState() 2361 2365 { -
trunk/Tools/WebKitTestRunner/TestController.h
r219319 r220412 176 176 void statisticsClearInMemoryAndPersistentStore(); 177 177 void statisticsClearInMemoryAndPersistentStoreModifiedSinceHours(unsigned); 178 void statisticsClearThroughWebsiteDataRemoval(); 178 179 void statisticsResetToConsistentState(); 179 180 -
trunk/Tools/WebKitTestRunner/TestInvocation.cpp
r219319 r220412 1143 1143 } 1144 1144 1145 if (WKStringIsEqualToUTF8CString(messageName, "StatisticsClearThroughWebsiteDataRemoval")) { 1146 TestController::singleton().statisticsClearThroughWebsiteDataRemoval(); 1147 return nullptr; 1148 } 1149 1145 1150 if (WKStringIsEqualToUTF8CString(messageName, "StatisticsResetToConsistentState")) { 1146 1151 TestController::singleton().statisticsResetToConsistentState(); … … 1227 1232 } 1228 1233 1234 void TestInvocation::didClearStatisticsThroughWebsiteDataRemoval() 1235 { 1236 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("CallDidClearStatisticsThroughWebsiteDataRemoval")); 1237 WKPagePostMessageToInjectedBundle(TestController::singleton().mainWebView()->page(), messageName.get(), 0); 1238 } 1239 1229 1240 void TestInvocation::didRemoveAllSessionCredentials() 1230 1241 { -
trunk/Tools/WebKitTestRunner/TestInvocation.h
r217886 r220412 72 72 void notifyDownloadDone(); 73 73 74 void didClearStatisticsThroughWebsiteDataRemoval(); 75 74 76 void didRemoveAllSessionCredentials(); 75 77 -
trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm
r219319 r220412 372 372 } 373 373 374 void TestController::statisticsClearThroughWebsiteDataRemoval() 375 { 376 #if WK_API_ENABLED 377 auto types = adoptNS([[NSSet alloc] initWithObjects:_WKWebsiteDataTypeResourceLoadStatistics, nil]); 378 [globalWebViewConfiguration.websiteDataStore removeDataOfTypes:types.get() modifiedSince:[NSDate distantPast] completionHandler:^() { 379 m_currentInvocation->didClearStatisticsThroughWebsiteDataRemoval(); 380 }]; 381 #endif 382 } 383 374 384 void TestController::statisticsResetToConsistentState() 375 385 {
Note: See TracChangeset
for help on using the changeset viewer.