Bug 175884 - [Cache API] UIProcess should provide the directory path where to store Cache Storage data
Summary: [Cache API] UIProcess should provide the directory path where to store Cache ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-08-23 08:18 PDT by youenn fablet
Modified: 2017-08-25 10:01 PDT (History)
4 users (show)

See Also:


Attachments
Patch (18.72 KB, patch)
2017-08-23 08:26 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (18.77 KB, patch)
2017-08-23 09:01 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (16.20 KB, patch)
2017-08-24 17:01 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Fixing typo (1.65 KB, patch)
2017-08-25 09:20 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.