Bug 186551 - NetworkLoadChecker should not need to hard ref NetworkConnectionToWebProcess
Summary: NetworkLoadChecker should not need to hard ref NetworkConnectionToWebProcess
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: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-06-11 17:47 PDT by youenn fablet
Modified: 2018-06-27 14:16 PDT (History)
7 users (show)

See Also:


Attachments
Patch (19.91 KB, patch)
2018-06-14 16:01 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (22.76 KB, patch)
2018-06-27 13:01 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2018-06-11 17:47:29 PDT
This is unnecessary and if ping loads last for long, it can keep NetworkConnectionToWebProcess alive for more time than it should
Comment 1 youenn fablet 2018-06-14 16:01:05 PDT
Created attachment 342772 [details]
Patch
Comment 2 Alex Christensen 2018-06-18 10:22:04 PDT
Comment on attachment 342772 [details]
Patch

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

Looks good to me.

> Source/WebCore/page/csp/ContentSecurityPolicy.h:172
> +    void setClient(ContentSecurityPolicyClient* client) { m_client = client; }

Ask Dan how he feels about this.

> Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp:200
> +        contentSecurityPolicy->setClient(client);
> +        bool isAllowed = isAllowedByContentSecurityPolicy(request);
> +        contentSecurityPolicy->setClient(nullptr);
> +        if (!isAllowed) {

This definitely has room for improvement.
Comment 3 youenn fablet 2018-06-27 13:01:00 PDT
Created attachment 343742 [details]
Patch for landing
Comment 4 WebKit Commit Bot 2018-06-27 14:15:30 PDT
Comment on attachment 343742 [details]
Patch for landing

Clearing flags on attachment: 343742

Committed r233277: <https://trac.webkit.org/changeset/233277>
Comment 5 WebKit Commit Bot 2018-06-27 14:15:32 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Radar WebKit Bug Importer 2018-06-27 14:16:26 PDT
<rdar://problem/41542890>