Bug 190687 - Only cap lifetime of persistent cookies created client-side through document.cookie when resource load statistics is enabled
Summary: Only cap lifetime of persistent cookies created client-side through document....
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: John Wilander
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-10-17 13:33 PDT by John Wilander
Modified: 2018-10-19 16:31 PDT (History)
8 users (show)

See Also:


Attachments
Patch (37.24 KB, patch)
2018-10-17 13:59 PDT, John Wilander
no flags Details | Formatted Diff | Diff
Patch (37.29 KB, patch)
2018-10-17 14:11 PDT, John Wilander
no flags Details | Formatted Diff | Diff
Patch (37.30 KB, patch)
2018-10-17 15:44 PDT, John Wilander
no flags Details | Formatted Diff | Diff
Patch (57.60 KB, patch)
2018-10-18 17:35 PDT, John Wilander
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews106 for mac-sierra-wk2 (3.23 MB, application/zip)
2018-10-18 18:39 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews124 for ios-simulator-wk2 (2.56 MB, application/zip)
2018-10-18 21:44 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews122 for ios-simulator-wk2 (2.87 MB, application/zip)
2018-10-18 23:29 PDT, EWS Watchlist
no flags Details
Patch (61.14 KB, patch)
2018-10-19 11:11 PDT, John Wilander
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Wilander 2018-10-17 13:33:15 PDT
We should restrict the change in https://bugs.webkit.org/show_bug.cgi?id=189933 to when resource load statistics is enabled.
Comment 1 Radar WebKit Bug Importer 2018-10-17 13:36:53 PDT
<rdar://problem/45349024>
Comment 2 John Wilander 2018-10-17 13:59:12 PDT
Created attachment 352636 [details]
Patch
Comment 3 John Wilander 2018-10-17 14:11:41 PDT
Created attachment 352637 [details]
Patch
Comment 4 Chris Dumez 2018-10-17 15:41:12 PDT
Regressions: Unexpected text-only failures (1)
  http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js.html [ Failure ]
Comment 5 John Wilander 2018-10-17 15:43:39 PDT
(In reply to Chris Dumez from comment #4)
> Regressions: Unexpected text-only failures (1)
>  
> http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js.html
> [ Failure ]

I moved the test last thing and forgot to update the relative path to cookie-utilities.js. :( New patch coming.
Comment 6 John Wilander 2018-10-17 15:44:37 PDT
Created attachment 352654 [details]
Patch
Comment 7 Chris Dumez 2018-10-18 08:54:17 PDT
Comment on attachment 352654 [details]
Patch

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

> Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp:213
> +        if (m_networkProcessCreated)

Which network process? The current models is that a single WebsiteDataStore / WebResourceLoadStatisticsStore can be associated with several WebProcessPools and thus several network processes.
As a result, this design relying on a single m_networkProcessCreated flag does not seem to make much sense.

> Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:1273
> +    for (auto& processPool : processPools()) {

See how you're iterating over several process pools here? That's right since a single WebsiteDataStore can be associated with several process pools.
Comment 8 John Wilander 2018-10-18 12:05:41 PDT
(In reply to Chris Dumez from comment #7)
> Comment on attachment 352654 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=352654&action=review
> 
> > Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp:213
> > +        if (m_networkProcessCreated)
> 
> Which network process? The current models is that a single WebsiteDataStore
> / WebResourceLoadStatisticsStore can be associated with several
> WebProcessPools and thus several network processes.
> As a result, this design relying on a single m_networkProcessCreated flag
> does not seem to make much sense.

I see. It may be mostly a naming thing, i.e. the boolean is saying "the first network process has been created so it makes sense to send it data."

But what I need to do is to think through how things are marked as "has already been sent to the network process." That's existing code that assumes that all network processes existed when the message went out. Maybe that state doesn't make sense and we should always send the complete set to all network processes.

> > Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:1273
> > +    for (auto& processPool : processPools()) {
> 
> See how you're iterating over several process pools here? That's right since
> a single WebsiteDataStore can be associated with several process pools.

I think this part is OK. ITP doesn't know how many network processes there are. It only needs to know that the first one has been created.

I will go through the code to see how this can make better sense.
Comment 9 John Wilander 2018-10-18 17:35:26 PDT
Created attachment 352751 [details]
Patch
Comment 10 John Wilander 2018-10-18 18:29:47 PDT
Test failures seem to be text diff output because of the removal of the in-memory-only state.
Comment 11 EWS Watchlist 2018-10-18 18:39:07 PDT
Comment on attachment 352751 [details]
Patch

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

New failing tests:
http/tests/webAPIStatistics/font-load-data-collection.html
http/tests/webAPIStatistics/canvas-read-and-write-data-collection.html
http/tests/webAPIStatistics/navigator-functions-accessed-data-collection.html
http/tests/webAPIStatistics/screen-functions-accessed-data-collection.html
Comment 12 EWS Watchlist 2018-10-18 18:39:09 PDT
Created attachment 352753 [details]
Archive of layout-test-results from ews106 for mac-sierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews106  Port: mac-sierra-wk2  Platform: Mac OS X 10.12.6
Comment 13 EWS Watchlist 2018-10-18 21:44:36 PDT
Comment on attachment 352751 [details]
Patch

Attachment 352751 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: https://webkit-queues.webkit.org/results/9659204

New failing tests:
http/tests/webAPIStatistics/font-load-data-collection.html
http/tests/webAPIStatistics/canvas-read-and-write-data-collection.html
http/tests/webAPIStatistics/navigator-functions-accessed-data-collection.html
http/tests/webAPIStatistics/screen-functions-accessed-data-collection.html
Comment 14 EWS Watchlist 2018-10-18 21:44:38 PDT
Created attachment 352765 [details]
Archive of layout-test-results from ews124 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews124  Port: ios-simulator-wk2  Platform: Mac OS X 10.13.6
Comment 15 EWS Watchlist 2018-10-18 23:29:00 PDT
Comment on attachment 352751 [details]
Patch

Attachment 352751 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: https://webkit-queues.webkit.org/results/9660495

New failing tests:
http/tests/webAPIStatistics/font-load-data-collection.html
http/tests/webAPIStatistics/canvas-read-and-write-data-collection.html
http/tests/webAPIStatistics/navigator-functions-accessed-data-collection.html
http/tests/webAPIStatistics/screen-functions-accessed-data-collection.html
Comment 16 EWS Watchlist 2018-10-18 23:29:02 PDT
Created attachment 352771 [details]
Archive of layout-test-results from ews122 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews122  Port: ios-simulator-wk2  Platform: Mac OS X 10.13.6
Comment 17 John Wilander 2018-10-19 11:11:54 PDT
Created attachment 352804 [details]
Patch
Comment 18 John Wilander 2018-10-19 14:12:45 PDT
Comment on attachment 352804 [details]
Patch

Thanks, Alex (and Chris)!
Comment 19 WebKit Commit Bot 2018-10-19 14:38:02 PDT
Comment on attachment 352804 [details]
Patch

Clearing flags on attachment: 352804

Committed r237304: <https://trac.webkit.org/changeset/237304>
Comment 20 WebKit Commit Bot 2018-10-19 14:38:04 PDT
All reviewed patches have been landed.  Closing bug.