Bug 174306 - Reset cookie partitioning state after network process crashes
Summary: Reset cookie partitioning state after network process crashes
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: 2017-07-09 20:04 PDT by Brent Fulgham
Modified: 2017-07-11 11:57 PDT (History)
4 users (show)

See Also:


Attachments
Patch (26.51 KB, patch)
2017-07-10 11:35 PDT, Brent Fulgham
no flags Details | Formatted Diff | Diff
Patch (26.41 KB, patch)
2017-07-10 12:45 PDT, Brent Fulgham
no flags Details | Formatted Diff | Diff
Patch (26.56 KB, patch)
2017-07-10 12:55 PDT, Brent Fulgham
no flags Details | Formatted Diff | Diff
Patch (27.68 KB, patch)
2017-07-10 19:30 PDT, Brent Fulgham
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews112 for mac-elcapitan (1.73 MB, application/zip)
2017-07-10 20:52 PDT, Build Bot
no flags Details
Patch (Rebaselined) (25.21 KB, patch)
2017-07-10 21:17 PDT, Brent Fulgham
no flags Details | Formatted Diff | Diff
Patch (25.78 KB, patch)
2017-07-11 10:21 PDT, Brent Fulgham
no flags Details | Formatted Diff | Diff
Patch (25.69 KB, patch)
2017-07-11 10:40 PDT, Brent Fulgham
cdumez: 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 2017-07-09 20:04:42 PDT
When the network process crashes, we need to notify the respawned process of the current knowledge of prevalent resources and other load statistics.
Comment 1 Brent Fulgham 2017-07-09 20:05:04 PDT
<rdar://problem/33171605>
Comment 2 Brent Fulgham 2017-07-10 11:35:45 PDT
Created attachment 314999 [details]
Patch
Comment 3 Brent Fulgham 2017-07-10 12:45:45 PDT
Created attachment 315011 [details]
Patch
Comment 4 Brent Fulgham 2017-07-10 12:55:32 PDT
Created attachment 315013 [details]
Patch
Comment 5 Brent Fulgham 2017-07-10 19:30:21 PDT
Created attachment 315064 [details]
Patch
Comment 6 Build Bot 2017-07-10 20:52:13 PDT
Comment on attachment 315064 [details]
Patch

Attachment 315064 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/4097651

New failing tests:
storage/indexeddb/modern/new-database-after-user-delete.html
Comment 7 Build Bot 2017-07-10 20:52:14 PDT
Created attachment 315071 [details]
Archive of layout-test-results from ews112 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews112  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 8 Brent Fulgham 2017-07-10 21:17:40 PDT
Created attachment 315074 [details]
Patch (Rebaselined)
Comment 9 Chris Dumez 2017-07-10 23:45:44 PDT
Comment on attachment 315074 [details]
Patch (Rebaselined)

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

Bots are red. Will do a proper review tomorrow.

> Source/WebKit2/UIProcess/WebProcessPool.cpp:485
> +#if HAVE(CFNETWORK_STORAGE_PARTITIONING)

The method we're calling is is not specific to partitioning (at least based on its name) and could be extended in the future to do other things. Therefore, I would move this ifdef to the implementation, where we actually call a partitioning-related method.

> Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.cpp:634
> +void WebResourceLoadStatisticsStore::networkProcessDidCrash()

I would call this scheduleCookiePartitioningStateReset. The "schedule" prefix is a pattern I have used for other methods in this class that dispatch to a background queue before doing something.

> Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.h:154
> +    void resetPartitionCookiesState();

Where is the implementation? Also, I would call this resetCookiePartitioningState.

> Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:1108
> +void WebsiteDataStore::notifyResourceLoadStatisticsNetworkProcessDidCrash()

I would just call this one networkProcessDidCrash(). You could imagine it being useful for other things than load statistics.
Comment 10 Brent Fulgham 2017-07-11 10:21:40 PDT
Created attachment 315123 [details]
Patch
Comment 11 Brent Fulgham 2017-07-11 10:32:35 PDT
Comment on attachment 315074 [details]
Patch (Rebaselined)

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

>> Source/WebKit2/UIProcess/WebProcessPool.cpp:485
>> +#if HAVE(CFNETWORK_STORAGE_PARTITIONING)
> 
> The method we're calling is is not specific to partitioning (at least based on its name) and could be extended in the future to do other things. Therefore, I would move this ifdef to the implementation, where we actually call a partitioning-related method.

Will do.

>> Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.cpp:634
>> +void WebResourceLoadStatisticsStore::networkProcessDidCrash()
> 
> I would call this scheduleCookiePartitioningStateReset. The "schedule" prefix is a pattern I have used for other methods in this class that dispatch to a background queue before doing something.

Makes sense.

>> Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.h:154
>> +    void resetPartitionCookiesState();
> 
> Where is the implementation? Also, I would call this resetCookiePartitioningState.

yes -- that's why the bots are red! Too many merges yesterday! :-)

>> Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:1108
>> +void WebsiteDataStore::notifyResourceLoadStatisticsNetworkProcessDidCrash()
> 
> I would just call this one networkProcessDidCrash(). You could imagine it being useful for other things than load statistics.

Will do.
Comment 12 Brent Fulgham 2017-07-11 10:40:18 PDT
Created attachment 315129 [details]
Patch
Comment 13 Chris Dumez 2017-07-11 10:55:02 PDT
Comment on attachment 315129 [details]
Patch

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

r=me if the bots are happy.

> Source/WebKit2/UIProcess/WebProcessPool.cpp:485
> +        m_websiteDataStore->websiteDataStore().networkProcessDidCrash();

Using websiteDataStore() instead of m_websiteDataStore would look safer as it returns a reference.

> LayoutTests/http/tests/loading/resourceLoadStatistics/resources/get-cookies.php:13
> +if(!isset($_COOKIE[$_GET["name3"]])) {

Could we also check that isset($_GET["name3"]) to avoid having to rebaseline other tests that do not have a name3?
Comment 14 Brent Fulgham 2017-07-11 11:17:18 PDT
Comment on attachment 315129 [details]
Patch

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

>> Source/WebKit2/UIProcess/WebProcessPool.cpp:485
>> +        m_websiteDataStore->websiteDataStore().networkProcessDidCrash();
> 
> Using websiteDataStore() instead of m_websiteDataStore would look safer as it returns a reference.

Will do.

>> LayoutTests/http/tests/loading/resourceLoadStatistics/resources/get-cookies.php:13
>> +if(!isset($_COOKIE[$_GET["name3"]])) {
> 
> Could we also check that isset($_GET["name3"]) to avoid having to rebaseline other tests that do not have a name3?

Yep. I just tried this and it works properly. It also reduces the size of this change.
Comment 15 Brent Fulgham 2017-07-11 11:57:22 PDT
Committed r219352: <http://trac.webkit.org/changeset/219352>