Don't call NetworkProcess::singleton from WebProcess when using NetworkSession
Created attachment 272509 [details] Patch
Created attachment 272511 [details] Patch
Comment on attachment 272511 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=272511&action=review > Source/WebKit2/WebProcess/WebProcess.cpp:194 > + NetworkSession::setCustomProtocolManager(nullptr); This doesn't do anything. Will land without it.
http://trac.webkit.org/changeset/197362
Comment on attachment 272511 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=272511&action=review > Source/WebKit2/NetworkProcess/cocoa/NetworkSessionCocoa.mm:221 > + NeverDestroyed<RefPtr<CustomProtocolManager>> gCustomProtocolManager; You really need “static” here. I’m not sure exactly what this will do without the static, but nothing good. I think in practice it means we will leak all the CustomProtocolManager objects and always have null for the protocol manager. Also, I don’t think you should name this local variable with a "g" prefix.
Sure enough. This regressed WebKit2CustomProtocolsTest when using NetworkSession for that very reason. Will fix.