[WK2][CustomProtocols] NSURLProtocolClient methods should be dispatched on NSURLConnection's resource loader run loop
<rdar://problem/13695891>
Created attachment 200378 [details] Patch
Comment on attachment 200378 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=200378&action=review > Source/WebKit2/Shared/Network/CustomProtocols/mac/CustomProtocolManagerMac.mm:205 > + RetainPtr<NSError> nsError(error.nsError()); I think that we prefer assignment syntax to initialization. > Source/WebKit2/Shared/Network/CustomProtocols/mac/CustomProtocolManagerMac.mm:220 > + RetainPtr<NSData> nsData([NSData dataWithBytes:(void*)data.data() length:data.size()]); This should be RetainPtr<NSData> nsData = adoptNS([[NSData alloc] initWithBytes:...]). No need to create an autoreleased object and thrash its refcount. > Source/WebKit2/Shared/Network/CustomProtocols/mac/CustomProtocolManagerMac.mm:233 > + RetainPtr<NSURLResponse> nsResponse(response.nsURLResponse()); I think that we prefer assignment syntax to initialization. > Source/WebKit2/Shared/Network/CustomProtocols/mac/CustomProtocolManagerMac.mm:269 > +void CustomProtocolManager::dispatchOnResourceLoaderRunLoop(void (^block)()) > +{ > + CFRunLoopPerformBlock([NSURLConnection resourceLoaderRunLoop], kCFRunLoopDefaultMode, block); > + CFRunLoopWakeUp([NSURLConnection resourceLoaderRunLoop]); > +} This looks like it should be a static function in .mm file.
Committed r149520: <http://trac.webkit.org/changeset/149520>