Bug 115185 - Thread safety issues in WKCustomProtocol
Summary: Thread safety issues in WKCustomProtocol
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac All
: P2 Normal
Assignee: Brady Eidson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2013-04-25 10:15 PDT by Brady Eidson
Modified: 2013-04-25 10:58 PDT (History)
3 users (show)

See Also:


Attachments
Patch v1 (5.84 KB, patch)
2013-04-25 10:22 PDT, Brady Eidson
ap: review+
Details | Formatted Diff | Diff

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