Bug 154689

Summary: [WK2] Stub support for WebsiteDataTypeResourceLoadStatistics
Product: WebKit Reporter: Brent Fulgham <bfulgham>
Component: WebKit2Assignee: Brent Fulgham <bfulgham>
Status: RESOLVED FIXED    
Severity: Normal CC: aestes, andersca, bfulgham, jberlin, sam, wilander
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch (Correct typo)
none
Patch
none
Patch (revised per Sam, rebaselined)
none
Patch (revised per Sam, rebaselined). sam: review+

Description Brent Fulgham 2016-02-25 12:59:43 PST
Provide a stub implementation of a proposed WKWebsiteDataStore method so we can write some internal tests.
Comment 1 Brent Fulgham 2016-02-25 13:00:27 PST
<rdar://problem/24702576>
Comment 2 Brent Fulgham 2016-02-25 13:11:45 PST
Created attachment 272228 [details]
Patch
Comment 3 Anders Carlsson 2016-02-25 13:34:54 PST
Comment on attachment 272228 [details]
Patch

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

This shouldn't be API.

> Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStore.mm:146
> +- (void)removeDataOfTypes:(NSSet *)dataTypes forURL:(NSURL *)url fromDate:(NSDate *)startData toDate:(NSDate *)endDate completionHandler:(void (^)(void))completionHandler

No, this is not how we remove data in the WKWebsiteDataStore world. See WKWebsiteDataRecord.
Comment 4 Brent Fulgham 2016-02-25 14:17:39 PST
Created attachment 272237 [details]
Patch
Comment 5 Brent Fulgham 2016-02-25 14:20:04 PST
(In reply to comment #3)
> Comment on attachment 272228 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=272228&action=review
> 
> This shouldn't be API.
> 
> > Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStore.mm:146
> > +- (void)removeDataOfTypes:(NSSet *)dataTypes forURL:(NSURL *)url fromDate:(NSDate *)startData toDate:(NSDate *)endDate completionHandler:(void (^)(void))completionHandler
> 
> No, this is not how we remove data in the WKWebsiteDataStore world. See
> WKWebsiteDataRecord.

OK. As we discussed offline we will use the existing API. We do need the new flag to handle deleting load statistics without getting rid of other stuff.
Comment 6 Brent Fulgham 2016-02-25 16:23:24 PST
Created attachment 272260 [details]
Patch (Correct typo)
Comment 7 Sam Weinig 2016-02-29 18:18:16 PST
Comment on attachment 272260 [details]
Patch (Correct typo)

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

> Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataRecord.h:50
> +/*! @constant WKWebsiteDataTypeResourceLoadStatistics Resource load statistics. */
> +WK_EXTERN NSString * const WKWebsiteDataTypeResourceLoadStatistics WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);

This needs to go in WKWebsiteDataRecordPrivate.h and gain an _.

> Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStore.mm:90
> +        allWebsiteDataTypes = [[NSSet alloc] initWithArray:@[ WKWebsiteDataTypeDiskCache, WKWebsiteDataTypeMemoryCache, WKWebsiteDataTypeOfflineWebApplicationCache, WKWebsiteDataTypeCookies, WKWebsiteDataTypeSessionStorage, WKWebsiteDataTypeLocalStorage, WKWebsiteDataTypeIndexedDBDatabases, WKWebsiteDataTypeWebSQLDatabases, WKWebsiteDataTypeResourceLoadStatistics ]];

Only API types should be in this set.
Comment 8 Brent Fulgham 2016-02-29 19:34:39 PST
Created attachment 272541 [details]
Patch
Comment 9 Brent Fulgham 2016-02-29 21:26:18 PST
Created attachment 272547 [details]
Patch (revised per Sam, rebaselined)
Comment 10 Brent Fulgham 2016-02-29 21:35:26 PST
Created attachment 272548 [details]
Patch (revised per Sam, rebaselined).
Comment 11 Sam Weinig 2016-03-01 16:19:03 PST
Comment on attachment 272548 [details]
Patch (revised per Sam, rebaselined).

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

> Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:47
> +NSString * const _WKWebsiteDataTypeResourceLoadStatistics = @"WKWebsiteDataTypeResourceLoadStatistics";

Please add underscore to string as well.
Comment 12 Brent Fulgham 2016-03-01 17:02:03 PST
Committed r197427: <http://trac.webkit.org/changeset/197427>