Regression (r215941) Unexpected logging causes perf tests to fail.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 30 Apr 2017 07:21:23 +0000 (07:21 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 30 Apr 2017 07:21:23 +0000 (07:21 +0000)
<rdar://problem/31907269> and https://bugs.webkit.org/show_bug.cgi?id=171482

Reviewed by Alexey Proskuryakov.

* Shared/mac/SandboxExtensionMac.mm:
(WebKit::resolveAndCreateReadWriteDirectoryForSandboxExtension):

* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::networkingCachesDirectory):
(WebKit::WebProcessPool::webContentCachesDirectory):

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): Only resolve the cookie storage directory
  if a custom one has been set.

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

Source/WebKit2/ChangeLog
Source/WebKit2/Shared/mac/SandboxExtensionMac.mm
Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm
Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp

index b7e6675..2a12a8a 100644 (file)
@@ -1,3 +1,21 @@
+2017-04-30  Brady Eidson  <beidson@apple.com>
+
+        Regression (r215941) Unexpected logging causes perf tests to fail.
+        <rdar://problem/31907269> and https://bugs.webkit.org/show_bug.cgi?id=171482
+
+        Reviewed by Alexey Proskuryakov.
+
+        * Shared/mac/SandboxExtensionMac.mm:
+        (WebKit::resolveAndCreateReadWriteDirectoryForSandboxExtension):
+
+        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+        (WebKit::WebProcessPool::networkingCachesDirectory):
+        (WebKit::WebProcessPool::webContentCachesDirectory):
+
+        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
+        (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): Only resolve the cookie storage directory
+          if a custom one has been set.
+
 2017-04-29  Youenn Fablet  <youenn@apple.com>
 
         Readd assertion removed accidentally in r215955
index 6be846b..441eb1e 100644 (file)
@@ -221,7 +221,7 @@ String resolveAndCreateReadWriteDirectoryForSandboxExtension(const String& path)
     NSString *nsPath = path;
 
     if (![[NSFileManager defaultManager] createDirectoryAtPath:nsPath withIntermediateDirectories:YES attributes:nil error:&error]) {
-        NSLog(@"could not create \"%@\", error %@", nsPath, error);
+        NSLog(@"could not create directory \"%@\" for future sandbox extension, error %@", nsPath, error);
         return { };
     }
 
index b27ccea..f31a41a 100644 (file)
@@ -338,7 +338,7 @@ String WebProcessPool::networkingCachesDirectory() const
     NSError *error = nil;
     NSString* nsPath = path;
     if (![[NSFileManager defaultManager] createDirectoryAtPath:nsPath withIntermediateDirectories:YES attributes:nil error:&error]) {
-        NSLog(@"could not create \"%@\", error %@", nsPath, error);
+        NSLog(@"could not create networking caches directory \"%@\", error %@", nsPath, error);
         return String();
     }
 
@@ -357,7 +357,7 @@ String WebProcessPool::webContentCachesDirectory() const
     NSError *error = nil;
     NSString* nsPath = path;
     if (![[NSFileManager defaultManager] createDirectoryAtPath:nsPath withIntermediateDirectories:YES attributes:nil error:&error]) {
-        NSLog(@"could not create \"%@\", error %@", nsPath, error);
+        NSLog(@"could not create web content caches directory \"%@\", error %@", nsPath, error);
         return String();
     }
 
index d425633..15d46c7 100644 (file)
@@ -116,9 +116,11 @@ void WebsiteDataStore::resolveDirectoriesIfNecessary()
     m_resolvedConfiguration.mediaCacheDirectory = resolveAndCreateReadWriteDirectoryForSandboxExtension(m_configuration.mediaCacheDirectory);
     m_resolvedConfiguration.mediaKeysStorageDirectory = resolveAndCreateReadWriteDirectoryForSandboxExtension(m_configuration.mediaKeysStorageDirectory);
     m_resolvedConfiguration.webSQLDatabaseDirectory = resolveAndCreateReadWriteDirectoryForSandboxExtension(m_configuration.webSQLDatabaseDirectory);
-    m_resolvedConfiguration.cookieStorageDirectory = resolveAndCreateReadWriteDirectoryForSandboxExtension(m_configuration.cookieStorageDirectory);
     m_resolvedConfiguration.indexedDBDatabaseDirectory = resolveAndCreateReadWriteDirectoryForSandboxExtension(m_configuration.indexedDBDatabaseDirectory);
 
+    if (!m_configuration.cookieStorageDirectory.isEmpty())
+        m_resolvedConfiguration.cookieStorageDirectory = resolveAndCreateReadWriteDirectoryForSandboxExtension(m_configuration.cookieStorageDirectory);
+
     if (!m_configuration.javaScriptConfigurationDirectory.isEmpty())
         m_resolvedConfiguration.javaScriptConfigurationDirectory = resolvePathForSandboxExtension(m_configuration.javaScriptConfigurationDirectory);
 }