Bug 187379 - Add support for fetching and remove type _WKWebsiteDataTypeHSTSCache
Summary: Add support for fetching and remove type _WKWebsiteDataTypeHSTSCache
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sihui Liu
URL:
Keywords: InRadar
Depends on:
Blocks: 188725
  Show dependency treegraph
 
Reported: 2018-07-05 22:34 PDT by Sihui Liu
Modified: 2018-08-18 16:48 PDT (History)
9 users (show)

See Also:


Attachments
Patch (18.47 KB, patch)
2018-07-05 22:44 PDT, Sihui Liu
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews100 for mac-sierra (2.31 MB, application/zip)
2018-07-06 00:30 PDT, EWS Watchlist
no flags Details
Patch (21.75 KB, patch)
2018-07-09 23:56 PDT, Sihui Liu
no flags Details | Formatted Diff | Diff
Patch (21.39 KB, patch)
2018-07-25 23:23 PDT, Sihui Liu
no flags Details | Formatted Diff | Diff
Patch for landing (21.32 KB, patch)
2018-07-30 15:43 PDT, Sihui Liu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sihui Liu 2018-07-05 22:34:00 PDT
Safari needs to show whether a host has HSTS cache and allow user to delete.
Comment 1 Sihui Liu 2018-07-05 22:34:41 PDT
<rdar://22331772>
Comment 2 Radar WebKit Bug Importer 2018-07-05 22:34:50 PDT
<rdar://problem/41879559>
Comment 3 Sihui Liu 2018-07-05 22:44:48 PDT
Created attachment 344403 [details]
Patch
Comment 4 EWS Watchlist 2018-07-06 00:30:46 PDT
Comment on attachment 344403 [details]
Patch

Attachment 344403 [details] did not pass mac-ews (mac):
Output: https://webkit-queues.webkit.org/results/8453501

New failing tests:
media/media-fullscreen-return-to-inline.html
Comment 5 EWS Watchlist 2018-07-06 00:30:48 PDT
Created attachment 344405 [details]
Archive of layout-test-results from ews100 for mac-sierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100  Port: mac-sierra  Platform: Mac OS X 10.12.6
Comment 6 Sihui Liu 2018-07-09 23:56:26 PDT
Created attachment 344673 [details]
Patch
Comment 7 Brent Fulgham 2018-07-25 09:34:07 PDT
Comment on attachment 344673 [details]
Patch

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

I think this looks very close, but I believe your change to WebsiteDataRecord::displayNameForCookieHostName will break some ITP functionality. r- to revise that section, but otherwise I think this looks good.

> Source/WebCore/PAL/ChangeLog:3
> +        Add support for fetching and remove type  _WKWebsiteDataTypeHSTSCache

You have an extra space between 'type' and '_WKWebsite..'

> Source/WebKit/ChangeLog:3
> +        Add support for fetching and remove type  _WKWebsiteDataTypeHSTSCache

Ditto.

> Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm:155
> +    HashSet<String>* hostnames = (HashSet<String>*)context;

You should use the proper C++ casting here (probably a reinterpret_cast).

> Source/WebKit/UIProcess/WebsiteData/WebsiteDataRecord.cpp:51
> +    return displayNameForHostName(hostName);

I don't think this change is correct, since you are losing the special handling of localhost and removal of the leading period.

> Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:1008
> +

Please remove this whitespace change.
Comment 8 Sihui Liu 2018-07-25 23:16:22 PDT
Comment on attachment 344673 [details]
Patch

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

>> Source/WebCore/PAL/ChangeLog:3
>> +        Add support for fetching and remove type  _WKWebsiteDataTypeHSTSCache
> 
> You have an extra space between 'type' and '_WKWebsite..'

Done.

>> Source/WebKit/ChangeLog:3
>> +        Add support for fetching and remove type  _WKWebsiteDataTypeHSTSCache
> 
> Ditto.

Done.

>> Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm:155
>> +    HashSet<String>* hostnames = (HashSet<String>*)context;
> 
> You should use the proper C++ casting here (probably a reinterpret_cast).

Yes! Will fix.

>> Source/WebKit/UIProcess/WebsiteData/WebsiteDataRecord.cpp:51
>> +    return displayNameForHostName(hostName);
> 
> I don't think this change is correct, since you are losing the special handling of localhost and removal of the leading period.

displayNameForHostName calls WebCore::topPrivatelyControlledDomain, and in WebCore::topPrivatelyControlledDomain we will check leading period and "localhost", so we could remove the check here.

>> Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:1008
>> +
> 
> Please remove this whitespace change.

Done.
Comment 9 Sihui Liu 2018-07-25 23:23:00 PDT
Created attachment 345829 [details]
Patch
Comment 10 Geoffrey Garen 2018-07-26 13:12:43 PDT
Comment on attachment 345829 [details]
Patch

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

r=me

> Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm:155
> +    HashSet<String>* hostnames = reinterpret_cast<HashSet<String>*>(context);

This can be static_cast because void* can static_cast to any pointer.
Comment 11 Sihui Liu 2018-07-30 15:43:21 PDT
Created attachment 346110 [details]
Patch for landing
Comment 12 WebKit Commit Bot 2018-07-30 16:23:47 PDT
Comment on attachment 346110 [details]
Patch for landing

Clearing flags on attachment: 346110

Committed r234396: <https://trac.webkit.org/changeset/234396>
Comment 13 WebKit Commit Bot 2018-07-30 16:23:49 PDT
All reviewed patches have been landed.  Closing bug.