Bug 180794

Summary: WebsiteDataStore::defaultDataStoreConfiguration() fails to set default value for serviceWorkerRegistrationDirectory
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: Service WorkersAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: beidson, berto, cgarcia, commit-queue, ews-watchlist, ggaren, gustavo, mcatanzaro, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=180784
Attachments:
Description Flags
Patch
none
Patch none

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>