Skip to content
Permalink
Browse files
Use fileURLWithPath instead of URLWithString in WebsiteDataStore::exc…
…ludeDirectoryFromBackup

https://bugs.webkit.org/show_bug.cgi?id=234582
rdar://86787798

Reviewed by Simon Fraser.

URLWithString may return nil while fileURLWithPath does not; and fileURLWithPath adds file:// to path correctly.

* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::excludeDirectoryFromBackup):



Canonical link: https://commits.webkit.org/245486@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@287344 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
szewai committed Dec 22, 2021
1 parent 9fac20f commit de05af429475cff7af0e8851a46ddf200d1a49e7
Showing 2 changed files with 15 additions and 2 deletions.
@@ -1,3 +1,16 @@
2021-12-21 Sihui Liu <sihui_liu@apple.com>

Use fileURLWithPath instead of URLWithString in WebsiteDataStore::excludeDirectoryFromBackup
https://bugs.webkit.org/show_bug.cgi?id=234582
rdar://86787798

Reviewed by Simon Fraser.

URLWithString may return nil while fileURLWithPath does not; and fileURLWithPath adds file:// to path correctly.

* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::excludeDirectoryFromBackup):

2021-12-21 Alex Christensen <achristensen@webkit.org>

Re-enable ContextMenu API tests
@@ -644,9 +644,9 @@ static NavigatingToAppBoundDomain schemeOrDomainIsAppBound(const String& host, c

void WebsiteDataStore::excludeDirectoryFromBackup(const String& directory)
{
NSURL *url = [NSURL URLWithString:(NSString *)directory];
NSURL *url = [NSURL fileURLWithPath:(NSString *)directory isDirectory:YES];
if ([[NSFileManager defaultManager] createDirectoryAtURL:url withIntermediateDirectories:YES attributes:nil error:nullptr])
[[NSURL fileURLWithPath:(NSString *)directory isDirectory:YES] setResourceValue:@YES forKey:NSURLIsExcludedFromBackupKey error:nil];
[url setResourceValue:@YES forKey:NSURLIsExcludedFromBackupKey error:nil];
}

#endif

0 comments on commit de05af4

Please sign in to comment.