Bug 180794 - WebsiteDataStore::defaultDataStoreConfiguration() fails to set default value for serviceWorkerRegistrationDirectory
Summary: WebsiteDataStore::defaultDataStoreConfiguration() fails to set default value ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Service Workers (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-12-13 19:01 PST by Chris Dumez
Modified: 2017-12-14 11:09 PST (History)
10 users (show)

See Also:


Attachments
Patch (4.70 KB, patch)
2017-12-13 19:04 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (3.18 KB, patch)
2017-12-14 09:48 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2017-12-13 19:01:38 PST
Add SPI to set the service worker registration directory to _WKWebsiteDataStoreConfiguration, similarly to what we do for IndexedDB.
Comment 1 Chris Dumez 2017-12-13 19:01:51 PST
<rdar://problem/36034667>
Comment 2 Chris Dumez 2017-12-13 19:04:23 PST
Created attachment 329310 [details]
Patch
Comment 3 Geoffrey Garen 2017-12-13 22:45:23 PST
Comment on attachment 329310 [details]
Patch

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

r=me

> Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:42
>  @property (nonatomic, copy, setter=_setWebStorageDirectory:) NSURL *_webStorageDirectory;
>  @property (nonatomic, copy, setter=_setIndexedDBDatabaseDirectory:) NSURL *_indexedDBDatabaseDirectory;
> +@property (nonatomic, copy, setter=_setServiceWorkerRegistrationDirectory:) NSURL *_serviceWorkerRegistrationDirectory WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
>  @property (nonatomic, copy, setter=_setWebSQLDatabaseDirectory:) NSURL *_webSQLDatabaseDirectory;
>  @property (nonatomic, copy, setter=_setCookieStorageFile:) NSURL *_cookieStorageFile;
>  @property (nonatomic, copy, setter=_setResourceLoadStatisticsDirectory:) NSURL *_resourceLoadStatisticsDirectory WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));

Seems kinda crazy that we require the client to set these separately for correct behavior.
Comment 4 Chris Dumez 2017-12-14 08:50:35 PST
(In reply to Geoffrey Garen from comment #3)
> Comment on attachment 329310 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=329310&action=review
> 
> r=me
> 
> > Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:42
> >  @property (nonatomic, copy, setter=_setWebStorageDirectory:) NSURL *_webStorageDirectory;
> >  @property (nonatomic, copy, setter=_setIndexedDBDatabaseDirectory:) NSURL *_indexedDBDatabaseDirectory;
> > +@property (nonatomic, copy, setter=_setServiceWorkerRegistrationDirectory:) NSURL *_serviceWorkerRegistrationDirectory WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
> >  @property (nonatomic, copy, setter=_setWebSQLDatabaseDirectory:) NSURL *_webSQLDatabaseDirectory;
> >  @property (nonatomic, copy, setter=_setCookieStorageFile:) NSURL *_cookieStorageFile;
> >  @property (nonatomic, copy, setter=_setResourceLoadStatisticsDirectory:) NSURL *_resourceLoadStatisticsDirectory WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
> 
> Seems kinda crazy that we require the client to set these separately for
> correct behavior.

Agreed, I may have a better fix. I am currently trying it out.
Comment 5 Chris Dumez 2017-12-14 09:48:07 PST
Created attachment 329357 [details]
Patch
Comment 6 EWS Watchlist 2017-12-14 09:50:49 PST
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 7 WebKit Commit Bot 2017-12-14 11:08:35 PST
Comment on attachment 329357 [details]
Patch

Clearing flags on attachment: 329357

Committed r225911: <https://trac.webkit.org/changeset/225911>
Comment 8 WebKit Commit Bot 2017-12-14 11:08:37 PST
All reviewed patches have been landed.  Closing bug.
Comment 9 Radar WebKit Bug Importer 2017-12-14 11:09:31 PST
<rdar://problem/36052798>