Bug 155080

Summary: [SOUP] Issues with CustomProtocolManagerImpl::registerScheme?
Product: WebKit Reporter: Michael Catanzaro <mcatanzaro>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Minor CC: bugs-noreply
Priority: P2    
Version: Other   
Hardware: PC   
OS: Linux   

Description Michael Catanzaro 2016-03-05 17:56:36 PST
I don't understand the implementation of CustomProtocolManagerImpl::registerScheme.

 * It calls g_type_class_ref twice for no apparent reason, and with no paired calls to g_type_class_unref that I could find. The second use should probably be g_type_class_peek instead. Maybe the first use should be paired with a g_type_class_unref somewhere. Even if we don't care about leaking the class struct, I don't see why we should ref it twice in the same place.
 * It assigns |this| to the |client| member of WebKitSoupRequestGenericClass, but that means it will clobber any other CustomProtocolManagerImpls that have previously registered themselves with the WebKitSoupRequestGenericClass struct. I guess only a single CustomProtocolManagerImpl is ever intended to be created, but it's not a singleton, so it feels kinda fragile.