Bug 115185

Summary: Thread safety issues in WKCustomProtocol
Product: WebKit Reporter: Brady Eidson <beidson>
Component: WebKit2Assignee: Brady Eidson <beidson>
Status: RESOLVED FIXED    
Severity: Normal CC: aestes, darin, sam
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: All   
Attachments:
Description Flags
Patch v1 ap: review+

Description Brady Eidson 2013-04-25 10:15:50 PDT
Thread safety issues in WKCustomProtocol

WebKit2's custom protocol management needs to coordinate access to the m_customProtocolMap

In radar as <rdar://problem/13247304>
Comment 1 Brady Eidson 2013-04-25 10:22:23 PDT
Created attachment 199681 [details]
Patch v1
Comment 2 Alexey Proskuryakov 2013-04-25 10:45:25 PDT
Comment on attachment 199681 [details]
Patch v1

View in context: https://bugs.webkit.org/attachment.cgi?id=199681&action=review

r=me assuming WKCustomProtocol is ThreadSafeRefCounted.

> Source/WebKit2/Shared/Network/CustomProtocols/CustomProtocolManager.h:101
> +    RetainPtr<WKCustomProtocol> protocolForID(uint64_t customProtocolID);

I'd add a comment explaining the RetainPtr. Looking at it, I already foolishly want to remove it :)
Comment 3 Brady Eidson 2013-04-25 10:52:51 PDT
(In reply to comment #2)
> (From update of attachment 199681 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=199681&action=review
> 
> r=me assuming WKCustomProtocol is ThreadSafeRefCounted.

It is - of course - an Obj-C class and therefore its Retain counting is thread safe.
> 
> > Source/WebKit2/Shared/Network/CustomProtocols/CustomProtocolManager.h:101
> > +    RetainPtr<WKCustomProtocol> protocolForID(uint64_t customProtocolID);
> 
> I'd add a comment explaining the RetainPtr. Looking at it, I already foolishly want to remove it :)

Indeed!

Thanks!
Comment 4 Brady Eidson 2013-04-25 10:58:12 PDT
http://trac.webkit.org/changeset/149121