RESOLVED FIXED 198692
[iOS] ResourceLoadStatistics state is not properly relayed to the NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=198692
Summary [iOS] ResourceLoadStatistics state is not properly relayed to the NetworkProcess
Brent Fulgham
Reported 2019-06-08 14:01:49 PDT
When I moved the ResourceLoadStatistics logic to the NetworkProcess, I did not realize that the iOS process startup does not have a WebsiteDataStore attached until much later in the launch cycle. Because of this, we do not pass the ITP state to the NetworkProcess at launch (as part of its configuration parameters), and when we attempt to message the state to the NetworkProcess during startup we do so at a moment when we have not associated the WebProcessPool with the WebsiteDataStore object that knows about ITP status. Furthermore, I failed to notice that the method to activate ITP only messages the WebContent processes, not the NetworkProcess. This had not been needed before I moved the logic to the NetworkProcess, and was an oversight. This patch updates WebProcessPool::setResourceLoadStatisticsEnabled so that the process pool tells the NetworkProcess when the ITP state changes.
Attachments
Patch (1.49 KB, patch)
2019-06-08 14:04 PDT, Brent Fulgham
no flags
Patch (1.49 KB, patch)
2019-06-08 16:50 PDT, Brent Fulgham
no flags
Patch (1.54 KB, patch)
2019-06-08 17:01 PDT, Brent Fulgham
no flags
Patch (1.58 KB, patch)
2019-06-08 18:20 PDT, Brent Fulgham
no flags
Patch (1.56 KB, patch)
2019-06-08 19:10 PDT, Brent Fulgham
no flags
Brent Fulgham
Comment 1 2019-06-08 14:03:37 PDT
Brent Fulgham
Comment 2 2019-06-08 14:04:43 PDT
John Wilander
Comment 3 2019-06-08 14:15:42 PDT
Comment on attachment 371666 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=371666&action=review > Source/WebKit/UIProcess/WebProcessPool.cpp:1491 > + sendToNetworkingProcess(Messages::WebProcess::SetResourceLoadStatisticsEnabled(enabled)); This message type should be for the NetworkProcess, not the WebProcess.
Maciej Stachowiak
Comment 4 2019-06-08 14:25:00 PDT
Comment on attachment 371666 [details] Patch This really needs a test, since it is a fix for a real regression and one that wen't long unnoticed. r- for lack of test case.
Brent Fulgham
Comment 5 2019-06-08 16:50:00 PDT
Brent Fulgham
Comment 6 2019-06-08 16:51:33 PDT
Comment on attachment 371681 [details] Patch Updated to use proper message heading. I'll tackle the test separately since it will be a larger patch.
Brent Fulgham
Comment 7 2019-06-08 17:01:23 PDT
Brent Fulgham
Comment 8 2019-06-08 17:01:46 PDT
Comment on attachment 371682 [details] Patch Updated to address WPE build failure.
John Wilander
Comment 9 2019-06-08 17:19:13 PDT
Comment on attachment 371682 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=371682&action=review > Source/WebKit/UIProcess/WebProcessPool.cpp:1492 > + sendToNetworkingProcess(Messages::NetworkProcess::SetResourceLoadStatisticsEnabled(enabled)); I’m looking at this on my phone so I don’t have the larger picture. Do we need to ensure that there is a network process here? I know we had some cases where that was a requirement.
Brent Fulgham
Comment 10 2019-06-08 17:44:15 PDT
Comment on attachment 371682 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=371682&action=review >> Source/WebKit/UIProcess/WebProcessPool.cpp:1492 >> + sendToNetworkingProcess(Messages::NetworkProcess::SetResourceLoadStatisticsEnabled(enabled)); > > I’m looking at this on my phone so I don’t have the larger picture. Do we need to ensure that there is a network process here? I know we had some cases where that was a requirement. That's probably a good idea. It looks like we do something like that when dealing with Ephemeral sessions, so this probably has the same requirement.
Brent Fulgham
Comment 11 2019-06-08 17:47:14 PDT
(In reply to Maciej Stachowiak from comment #4) > Comment on attachment 371666 [details] > Patch > > This really needs a test, since it is a fix for a real regression and one > that wen't long unnoticed. r- for lack of test case. I started doing this, but the patch grew much larger. I would rather handle the test case as a distinct patch so that it's clear what's going on. See Bug 198694 for that work.
Brent Fulgham
Comment 12 2019-06-08 18:20:44 PDT
Brent Fulgham
Comment 13 2019-06-08 19:07:27 PDT
(In reply to Brent Fulgham from comment #10) > Comment on attachment 371682 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=371682&action=review > > >> Source/WebKit/UIProcess/WebProcessPool.cpp:1492 > >> + sendToNetworkingProcess(Messages::NetworkProcess::SetResourceLoadStatisticsEnabled(enabled)); > > > > I’m looking at this on my phone so I don’t have the larger picture. Do we need to ensure that there is a network process here? I know we had some cases where that was a requirement. > > That's probably a good idea. It looks like we do something like that when > dealing with Ephemeral sessions, so this probably has the same requirement. Actually it's not a good idea because it breaks the API tests involving a lack of a process pool (TestWebKitAPI.WebKit.WKHTTPCookieStoreWithoutProcessPoolWithPrewarming and the without prewarming case). So, we don't want to force a network process launch if it doesn't already exist -- we just want to make sure we do send it the message.
Brent Fulgham
Comment 14 2019-06-08 19:10:16 PDT
Maciej Stachowiak
Comment 15 2019-06-09 16:30:20 PDT
Comment on attachment 371697 [details] Patch Looks good.
WebKit Commit Bot
Comment 16 2019-06-09 17:25:25 PDT
Comment on attachment 371697 [details] Patch Clearing flags on attachment: 371697 Committed r246248: <https://trac.webkit.org/changeset/246248>
WebKit Commit Bot
Comment 17 2019-06-09 17:25:27 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.