Bug 155080 - [SOUP] Issues with CustomProtocolManagerImpl::registerScheme?
Summary: [SOUP] Issues with CustomProtocolManagerImpl::registerScheme?
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: Other
Hardware: PC Linux
: P2 Minor
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-05 17:56 PST by Michael Catanzaro
Modified: 2016-03-05 17:56 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.