Bug 175884

Summary: [Cache API] UIProcess should provide the directory path where to store Cache Storage data
Product: WebKit Reporter: youenn fablet <youennf>
Component: WebCore Misc.Assignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, beidson, commit-queue, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch for landing
none
Fixing typo none

Description youenn fablet 2017-08-23 08:18:40 PDT
And its sandbox extension as well.
Comment 1 youenn fablet 2017-08-23 08:26:57 PDT
Created attachment 318870 [details]
Patch
Comment 2 youenn fablet 2017-08-23 09:01:39 PDT
Created attachment 318874 [details]
Patch
Comment 3 Brady Eidson 2017-08-24 09:19:16 PDT
Comment on attachment 318874 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=318874&action=review

R+ with comments

> Source/WebKit/UIProcess/API/C/WKContextConfigurationRef.h:43
> +WK_EXPORT WKStringRef WKContextConfigurationCopyCacheStorageDirectory(WKContextConfigurationRef configuration);
> +WK_EXPORT void WKContextConfigurationSetCacheStorageDirectory(WKContextConfigurationRef configuration, WKStringRef cacheStorageDirectory);
> +

Since there's no tests and therefore no user of this API, just skip it in this patch.

When we do need to expose the API to set the directory, please do so on WKProcessPool instead.

The C-API should be a dead man walking at this point.

> Source/WebKit/UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:58
> +String WebsiteDataStore::defaultCacheStorageDirectory()
> +{
> +    return cacheDirectoryFileSystemRepresentation("CacheStorage");
> +}

I know you're not using this yet, but probably plan to soon.

That said, cacheDirectoryFileSystemRepresentation() is wrong as it picks a directory in the NSCachesDirectory folder.

I think we want websiteDataDirectoryFileSystemRepresentation() instead
Comment 4 youenn fablet 2017-08-24 17:01:24 PDT
Created attachment 319040 [details]
Patch for landing
Comment 5 WebKit Commit Bot 2017-08-24 18:08:20 PDT
Comment on attachment 319040 [details]
Patch for landing

Clearing flags on attachment: 319040

Committed r221175: <http://trac.webkit.org/changeset/221175>
Comment 6 WebKit Commit Bot 2017-08-24 18:08:21 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2017-08-24 18:09:33 PDT
<rdar://problem/34072441>
Comment 8 youenn fablet 2017-08-25 09:20:02 PDT
Reopening to attach new patch.
Comment 9 youenn fablet 2017-08-25 09:20:03 PDT
Created attachment 319082 [details]
Fixing typo
Comment 10 WebKit Commit Bot 2017-08-25 10:01:37 PDT
Comment on attachment 319082 [details]
Fixing typo

Clearing flags on attachment: 319082

Committed r221190: <http://trac.webkit.org/changeset/221190>
Comment 11 WebKit Commit Bot 2017-08-25 10:01:39 PDT
All reviewed patches have been landed.  Closing bug.