Bug 193243

Summary: Stop using NetworkProcess::singleton in NetworkCache code
Product: WebKit Reporter: Alex Christensen <achristensen>
Component: New BugsAssignee: Alex Christensen <achristensen>
Status: RESOLVED FIXED    
Severity: Normal CC: aestes, beidson, bfulgham, cdumez, cgarcia, ews-watchlist, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch bfulgham: review+

Description Alex Christensen 2019-01-08 09:44:31 PST
Stop using NetworkProcess::singleton in NetworkCache code
Comment 1 Alex Christensen 2019-01-08 09:44:41 PST
Created attachment 358604 [details]
Patch
Comment 2 Alex Christensen 2019-01-08 10:11:07 PST
Created attachment 358609 [details]
Patch
Comment 3 Brent Fulgham 2019-01-08 13:17:41 PST
Comment on attachment 358609 [details]
Patch

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

> Source/WebKit/ChangeLog:4
> +        https://bugs.webkit.org/show_bug.cgi?id=193243

Missing radar...

> Source/WebKit/NetworkProcess/cache/NetworkCache.h:166
> +    Ref<NetworkProcess> m_networkProcess;

This means that the NetworkCache will keep the NetworkProcess alive. Is that the right ownership model? (I'm not disagreeing, just want to be sure that's correct).

Otherwise we could make this a WeakPtr.

However, since it was a singleton before, I assume the expectation is we never have a cache without a process (and vice versa).
Comment 4 Chris Dumez 2019-01-08 13:18:58 PST
(In reply to Brent Fulgham from comment #3)
> Comment on attachment 358609 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=358609&action=review
> 
> > Source/WebKit/ChangeLog:4
> > +        https://bugs.webkit.org/show_bug.cgi?id=193243
> 
> Missing radar...

We do not have a requirement have having a radar, do we? radars get auto-filed when the patch gets committed.
Comment 5 Alex Christensen 2019-01-08 13:22:20 PST
The NetworkCache will soon be a member of the NetworkSession, which should keep the NetworkProcess alive.
Thanks for the review.
Comment 6 Alex Christensen 2019-01-08 13:23:11 PST
http://trac.webkit.org/r239740
Comment 7 Radar WebKit Bug Importer 2019-01-08 13:24:28 PST
<rdar://problem/47125976>