Bug 201821 - Simplify WebResourceLoadObserver now that we have one WebProcess per session
Summary: Simplify WebResourceLoadObserver now that we have one WebProcess per session
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-09-16 09:18 PDT by Chris Dumez
Modified: 2019-09-16 14:22 PDT (History)
13 users (show)

See Also:


Attachments
Patch (30.04 KB, patch)
2019-09-16 09:27 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (30.65 KB, patch)
2019-09-16 11:02 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (30.65 KB, patch)
2019-09-16 11:03 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (33.50 KB, patch)
2019-09-16 12:53 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (33.32 KB, patch)
2019-09-16 13:07 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2019-09-16 09:18:38 PDT
Simplify WebResourceLoadObserver now that we have one WebProcess per session.
Comment 1 Chris Dumez 2019-09-16 09:27:11 PDT
Created attachment 378865 [details]
Patch
Comment 2 Brent Fulgham 2019-09-16 09:41:16 PDT
WinCairo failure appears to be a bot problem, unrelated to this patch.
Comment 3 Brent Fulgham 2019-09-16 09:46:22 PDT
Comment on attachment 378865 [details]
Patch

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

> Source/WebKit/ChangeLog:9
> +        No need to pass sessionIDs around or stores statistics per sessionID.

"or store"

> Source/WebKit/WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:-214
> -        return;

Do we really not need this anymore? Even if we don't need to pass sessionID to the rest of the ITP system, surely preventing passing of observations when we should don't log for the current network session seems like a good idea?

> Source/WebKit/WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:-238
> -        return;

Ditto.

> Source/WebKit/WebProcess/WebProcess.cpp:456
> +    if (parameters.resourceLoadStatisticsEnabled && !parameters.sessionID.isEphemeral())

While we don't log ITP data for ephemeral systems right now, we do want to apply these protections in the future. But I guess this is fine for now.
Comment 4 Chris Dumez 2019-09-16 09:56:01 PDT
Comment on attachment 378865 [details]
Patch

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

>> Source/WebKit/WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:-214
>> -        return;
> 
> Do we really not need this anymore? Even if we don't need to pass sessionID to the rest of the ITP system, surely preventing passing of observations when we should don't log for the current network session seems like a good idea?

If you look at WebProcess.cpp, you'll see that I do not even initialize the WebResourceLoadObserver if ITP is disabled or the sessionID is ephemeral.

Actually, I should probably drop the shouldLogResourceLoadStatistics() method entirely, looks like I forgot.
Comment 5 Chris Dumez 2019-09-16 09:58:34 PDT
(In reply to Chris Dumez from comment #4)
> Comment on attachment 378865 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=378865&action=review
> 
> >> Source/WebKit/WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:-214
> >> -        return;
> > 
> > Do we really not need this anymore? Even if we don't need to pass sessionID to the rest of the ITP system, surely preventing passing of observations when we should don't log for the current network session seems like a good idea?
> 
> If you look at WebProcess.cpp, you'll see that I do not even initialize the
> WebResourceLoadObserver if ITP is disabled or the sessionID is ephemeral.
> 
> Actually, I should probably drop the shouldLogResourceLoadStatistics()
> method entirely, looks like I forgot.

The ITP system already has the sessionID without the WebContent process sending it to it since the NetworkConnectionToWebProcess knows the sessionID.
Comment 6 Chris Dumez 2019-09-16 09:59:09 PDT
Comment on attachment 378865 [details]
Patch

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

> Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp:696
> +    if (auto* networkSession = this->networkSession()) {

See here, it is getting the networkSession for the sessionID of the WebProcess (See implementation of networkSession()).
Comment 7 Brent Fulgham 2019-09-16 10:04:32 PDT
Comment on attachment 378865 [details]
Patch

Looks good. r=me.
Comment 8 Chris Dumez 2019-09-16 11:02:18 PDT
Created attachment 378873 [details]
Patch
Comment 9 Chris Dumez 2019-09-16 11:03:50 PDT
Created attachment 378874 [details]
Patch
Comment 10 Chris Dumez 2019-09-16 12:53:40 PDT
Created attachment 378881 [details]
Patch
Comment 11 Chris Dumez 2019-09-16 13:07:00 PDT
Created attachment 378886 [details]
Patch
Comment 12 WebKit Commit Bot 2019-09-16 14:21:36 PDT
Comment on attachment 378886 [details]
Patch

Clearing flags on attachment: 378886

Committed r249920: <https://trac.webkit.org/changeset/249920>
Comment 13 WebKit Commit Bot 2019-09-16 14:21:38 PDT
All reviewed patches have been landed.  Closing bug.
Comment 14 Radar WebKit Bug Importer 2019-09-16 14:22:18 PDT
<rdar://problem/55414296>