Remove more NetworkProcess::singleton use
Created attachment 359251 [details] Patch
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.
(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