Changeset 251672 in webkit
- Timestamp:
- Oct 28, 2019 2:38:26 PM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r251665 r251672 1 2019-10-28 Kate Cheney <katherine_cheney@apple.com> 2 3 Layout Test http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html is a flaky failure 4 https://bugs.webkit.org/show_bug.cgi?id=203491 5 <rdar://problem/56674176> 6 7 Reviewed by Chris Dumez. 8 9 No new tests, this change is tested by the existing resourceLoadStatistics 10 tests. 11 12 This test started flaking when a new memory store was being created 13 between tests to maintain consistency. The call to grandfatherExistingWebsiteData 14 from populateMemoryStoreFromDisk in the persistent storage was 15 async, causing a race condition that led to occasional failures. 16 Adding a completion handler and changing the callsite of 17 populateMemoryStoreFromDisk should fix this problem. 18 19 * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp: 20 (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage): 21 * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.h: 22 * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: 23 (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): 24 The persistent store in the databaseEnabled case was never being used 25 and is unnecessary. 26 27 (WebKit::WebResourceLoadStatisticsStore::populateMemoryStoreFromDisk): 28 Since persistent storage only exists when using the memory store, 29 populateMemoryStoreFromDisk should check if 30 m_persistentStorage has been initialized. 31 32 * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: 33 * NetworkProcess/NetworkProcess.cpp: 34 (WebKit::NetworkProcess::setUseITPDatabase): 35 * NetworkProcess/NetworkSession.cpp: 36 (WebKit::NetworkSession::setResourceLoadStatisticsEnabled): 37 (WebKit::NetworkSession::recreateResourceLoadStatisticStore): 38 * NetworkProcess/NetworkSession.h: 39 1 40 2019-10-28 Wenson Hsieh <wenson_hsieh@apple.com> 2 41 -
trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp
r249313 r251672 65 65 m_memoryStore.setPersistentStorage(*this); 66 66 67 populateMemoryStoreFromDisk();68 67 startMonitoringDisk(); 69 68 } -
trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.h
r249313 r251672 55 55 enum class ForceImmediateWrite { No, Yes, }; 56 56 void scheduleOrWriteMemoryStore(ForceImmediateWrite); 57 void populateMemoryStoreFromDisk(); 57 58 58 59 private: … … 65 66 66 67 void writeMemoryStoreToDisk(); 67 void populateMemoryStoreFromDisk();68 68 void excludeFromBackup() const; 69 69 void refreshMemoryStoreFromDisk(); -
trunk/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp
r251663 r251672 163 163 164 164 auto memoryStore = makeUnique<ResourceLoadStatisticsMemoryStore>(*this, m_statisticsQueue, shouldIncludeLocalhost); 165 auto persistentStore = makeUnique<ResourceLoadStatisticsPersistentStorage>(*memoryStore, m_statisticsQueue, resourceLoadStatisticsDirectory);166 167 165 downcast<ResourceLoadStatisticsDatabaseStore>(*m_statisticsStore.get()).populateFromMemoryStore(*memoryStore); 168 166 } else { … … 222 220 }); 223 221 semaphore.wait(); 222 } 223 224 void WebResourceLoadStatisticsStore::populateMemoryStoreFromDisk(CompletionHandler<void()>&& completionHandler) 225 { 226 ASSERT(RunLoop::isMain()); 227 228 postTask([this, completionHandler = WTFMove(completionHandler)]() mutable { 229 if (m_persistentStorage) 230 m_persistentStorage->populateMemoryStoreFromDisk(); 231 232 postTaskReply(WTFMove(completionHandler)); 233 }); 224 234 } 225 235 -
trunk/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h
r251663 r251672 107 107 WTF::WorkQueue& statisticsQueue() { return m_statisticsQueue.get(); } 108 108 109 void populateMemoryStoreFromDisk(CompletionHandler<void()>&&); 109 110 void setNotifyPagesWhenDataRecordsWereScanned(bool); 110 111 void setNotifyPagesWhenTelemetryWasCaptured(bool, CompletionHandler<void()>&&); -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp
r251663 r251672 666 666 if (m_isITPDatabaseEnabled != value) { 667 667 m_isITPDatabaseEnabled = value; 668 networkSession->recreateResourceLoadStatisticStore( );669 } 670 completionHandler();668 networkSession->recreateResourceLoadStatisticStore(WTFMove(completionHandler)); 669 } else 670 completionHandler(); 671 671 } else { 672 672 ASSERT_NOT_REACHED(); -
trunk/Source/WebKit/NetworkProcess/NetworkSession.cpp
r251663 r251672 165 165 166 166 m_resourceLoadStatistics = WebResourceLoadStatisticsStore::create(*this, m_resourceLoadStatisticsDirectory, m_shouldIncludeLocalhostInResourceLoadStatistics); 167 m_resourceLoadStatistics->populateMemoryStoreFromDisk([] { }); 167 168 168 169 if (m_enableResourceLoadStatisticsDebugMode == EnableResourceLoadStatisticsDebugMode::Yes) … … 174 175 } 175 176 176 void NetworkSession::recreateResourceLoadStatisticStore( )177 void NetworkSession::recreateResourceLoadStatisticStore(CompletionHandler<void()>&& completionHandler) 177 178 { 178 179 destroyResourceLoadStatistics(); 179 180 m_resourceLoadStatistics = WebResourceLoadStatisticsStore::create(*this, m_resourceLoadStatisticsDirectory, m_shouldIncludeLocalhostInResourceLoadStatistics); 181 m_resourceLoadStatistics->populateMemoryStoreFromDisk(WTFMove(completionHandler)); 180 182 } 181 183 -
trunk/Source/WebKit/NetworkProcess/NetworkSession.h
r251663 r251672 85 85 WebResourceLoadStatisticsStore* resourceLoadStatistics() const { return m_resourceLoadStatistics.get(); } 86 86 void setResourceLoadStatisticsEnabled(bool); 87 void recreateResourceLoadStatisticStore( );87 void recreateResourceLoadStatisticStore(CompletionHandler<void()>&&); 88 88 bool isResourceLoadStatisticsEnabled() const; 89 89 void notifyResourceLoadStatisticsProcessed();
Note: See TracChangeset
for help on using the changeset viewer.