⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 287344 in webkit


Ignore:
Timestamp:
Dec 21, 2021, 8:52:39 PM (5 years ago)
Author:
sihui_liu@apple.com
Message:

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):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r287343 r287344  
     12021-12-21  Sihui Liu  <sihui_liu@apple.com>
     2
     3        Use fileURLWithPath instead of URLWithString in WebsiteDataStore::excludeDirectoryFromBackup
     4        https://bugs.webkit.org/show_bug.cgi?id=234582
     5        rdar://86787798
     6
     7        Reviewed by Simon Fraser.
     8
     9        URLWithString may return nil while fileURLWithPath does not; and fileURLWithPath adds file:// to path correctly.
     10
     11        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
     12        (WebKit::WebsiteDataStore::excludeDirectoryFromBackup):
     13
    1142021-12-21  Alex Christensen  <achristensen@webkit.org>
    215
  • trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm

    r287232 r287344  
    645645void WebsiteDataStore::excludeDirectoryFromBackup(const String& directory)
    646646{
    647     NSURL *url = [NSURL URLWithString:(NSString *)directory];
     647    NSURL *url = [NSURL fileURLWithPath:(NSString *)directory isDirectory:YES];
    648648    if ([[NSFileManager defaultManager] createDirectoryAtURL:url withIntermediateDirectories:YES attributes:nil error:nullptr])
    649         [[NSURL fileURLWithPath:(NSString *)directory isDirectory:YES] setResourceValue:@YES forKey:NSURLIsExcludedFromBackupKey error:nil];
    650 }
    651 
    652 #endif
    653 
    654 }
     649        [url setResourceValue:@YES forKey:NSURLIsExcludedFromBackupKey error:nil];
     650}
     651
     652#endif
     653
     654}
Note: See TracChangeset for help on using the changeset viewer.