NEW 193484
Remove more NetworkProcess::singleton use
https://bugs.webkit.org/show_bug.cgi?id=193484
Summary Remove more NetworkProcess::singleton use
Alex Christensen
Reported 2019-01-15 20:10:20 PST
Remove more NetworkProcess::singleton use
Attachments
Patch (8.18 KB, patch)
2019-01-15 20:13 PST, Alex Christensen
ggaren: review+
Alex Christensen
Comment 1 2019-01-15 20:13:40 PST
Geoffrey Garen
Comment 2 2019-01-15 20:40:12 PST
Comment on attachment 359251 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=359251&action=review r=me > Source/WebKit/NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm:51 > +void LegacyCustomProtocolManager::networkProcessCreated(NetworkProcess& networkProcess) > +{ > + newestNetworkProcess() = &networkProcess; > +} I think we expect clients that use LegacyCustomProtocolManager never to make more than one NetworkProcess, and we expect clients that make more than one NetworkProcess never to use LegacyCustomProtocolManager. Is that right? If so, I think it would be clearer to remember the *first* NetworkProcess created, and ASSERT that, if another one is created, LegacyCustomProtocolManager has no registered protocols.
Alex Christensen
Comment 3 2019-01-15 20:58:28 PST
(In reply to Geoffrey Garen from comment #2) > Comment on attachment 359251 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=359251&action=review > > r=me > > > Source/WebKit/NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm:51 > > +void LegacyCustomProtocolManager::networkProcessCreated(NetworkProcess& networkProcess) > > +{ > > + newestNetworkProcess() = &networkProcess; > > +} > > I think we expect clients that use LegacyCustomProtocolManager never to make > more than one NetworkProcess, and we expect clients that make more than one > NetworkProcess never to use LegacyCustomProtocolManager. Is that right? That will be right. > > If so, I think it would be clearer to remember the *first* NetworkProcess > created, and ASSERT that, if another one is created, > LegacyCustomProtocolManager has no registered protocols. Done! http://trac.webkit.org/r240030
Note You need to log in before you can comment on or make changes to this bug.