Regression(r233359): Caused ITP tests to be flaky
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jun 2018 21:00:50 +0000 (21:00 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jun 2018 21:00:50 +0000 (21:00 +0000)
https://bugs.webkit.org/show_bug.cgi?id=187189

Reviewed by Youenn Fablet.

r233359 started using m_resolvedConfiguration.resourceLoadStatisticsDirectory instead of
m_configuration.resourceLoadStatisticsDirectory for the ITP path. This is consistent
with what we do for other database paths so that things like '~' in paths get resolved.

This introduced flakiness because the resourceLoadStatisticsDirectory was never getting
resolved and m_resolvedConfiguration.resourceLoadStatisticsDirectory was not set.
Update the WebsiteDataStore so that m_resolvedConfiguration.resourceLoadStatisticsDirectory
properly gets set to the resolved version of m_configuration.resourceLoadStatisticsDirectory.

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
(WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233371 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp

index a5f124d..6b9f04e 100644 (file)
@@ -1,3 +1,23 @@
+2018-06-29  Chris Dumez  <cdumez@apple.com>
+
+        Regression(r233359): Caused ITP tests to be flaky
+        https://bugs.webkit.org/show_bug.cgi?id=187189
+
+        Reviewed by Youenn Fablet.
+
+        r233359 started using m_resolvedConfiguration.resourceLoadStatisticsDirectory instead of
+        m_configuration.resourceLoadStatisticsDirectory for the ITP path. This is consistent
+        with what we do for other database paths so that things like '~' in paths get resolved.
+
+        This introduced flakiness because the resourceLoadStatisticsDirectory was never getting
+        resolved and m_resolvedConfiguration.resourceLoadStatisticsDirectory was not set.
+        Update the WebsiteDataStore so that m_resolvedConfiguration.resourceLoadStatisticsDirectory
+        properly gets set to the resolved version of m_configuration.resourceLoadStatisticsDirectory.
+
+        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
+        (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
+        (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
+
 2018-06-29  John Wilander  <wilander@apple.com>
 
         Resource Load Statistics: Don't create a WebResourceLoadStatisticsStore for ephemeral sessions
index 4018fc7..4a16ceb 100644 (file)
@@ -162,6 +162,8 @@ void WebsiteDataStore::resolveDirectoriesIfNecessary()
         m_resolvedConfiguration.webSQLDatabaseDirectory = resolveAndCreateReadWriteDirectoryForSandboxExtension(m_configuration.webSQLDatabaseDirectory);
     if (!m_configuration.indexedDBDatabaseDirectory.isEmpty())
         m_resolvedConfiguration.indexedDBDatabaseDirectory = resolveAndCreateReadWriteDirectoryForSandboxExtension(m_configuration.indexedDBDatabaseDirectory);
+    if (!m_configuration.resourceLoadStatisticsDirectory.isEmpty())
+        m_resolvedConfiguration.resourceLoadStatisticsDirectory = resolveAndCreateReadWriteDirectoryForSandboxExtension(m_configuration.resourceLoadStatisticsDirectory);
     if (!m_configuration.serviceWorkerRegistrationDirectory.isEmpty() && m_resolvedConfiguration.serviceWorkerRegistrationDirectory.isEmpty())
         m_resolvedConfiguration.serviceWorkerRegistrationDirectory = resolveAndCreateReadWriteDirectoryForSandboxExtension(m_configuration.serviceWorkerRegistrationDirectory);
     if (!m_configuration.javaScriptConfigurationDirectory.isEmpty())
@@ -1478,6 +1480,7 @@ void WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback(Functio
         return;
     }
 
+    resolveDirectoriesIfNecessary();
     m_resourceLoadStatistics = WebResourceLoadStatisticsStore::create(*this);
     m_resourceLoadStatistics->setStatisticsTestingCallback(WTFMove(callback));