The code is cross-platform but it's duplicated in CF and GLib implementations, it could be shared instead.
Created attachment 306056 [details] Patch
Committed r214732: <http://trac.webkit.org/changeset/214732>