Bug 154689 - [WK2] Stub support for WebsiteDataTypeResourceLoadStatistics
Summary: [WK2] Stub support for WebsiteDataTypeResourceLoadStatistics
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-02-25 12:59 PST by Brent Fulgham
Modified: 2016-03-01 17:02 PST (History)
6 users (show)

See Also:


Attachments
Patch (8.71 KB, patch)
2016-02-25 13:11 PST, Brent Fulgham
no flags Details | Formatted Diff | Diff
Patch (7.26 KB, patch)
2016-02-25 14:17 PST, Brent Fulgham
no flags Details | Formatted Diff | Diff
Patch (Correct typo) (7.26 KB, patch)
2016-02-25 16:23 PST, Brent Fulgham
no flags Details | Formatted Diff | Diff
Patch (5.67 KB, patch)
2016-02-29 19:34 PST, Brent Fulgham
no flags Details | Formatted Diff | Diff
Patch (revised per Sam, rebaselined) (5.34 KB, patch)
2016-02-29 21:26 PST, Brent Fulgham
no flags Details | Formatted Diff | Diff
Patch (revised per Sam, rebaselined). (5.35 KB, patch)
2016-02-29 21:35 PST, Brent Fulgham
sam: review+
Details | Formatted Diff | Diff

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