-
beidson authored
Reviewed by Adele <rdar://problem/4429701> Implements a port blocking black list that matches Firefox's The layout test attempts to load an image at an invalid domain name on each of the black listed ports. Using dumpResourceLoadCallbacks(), DRT is able to see the error codes for each resource. A successful test shows the blocked error for each image load except for the few that are standard or should succeed due to exemptions. * security/block-test-expected.txt: Added. * security/block-test.html: Added. WebCore: Reviewed by Maciej <rdar://problem/4429701> Implements a port blocking black list that matches Firefox's * loader/FrameLoader.cpp: (WebCore::FrameLoader::blockedError): Call through to the client for blockedError * loader/FrameLoader.h: * loader/FrameLoaderClient.h: Get the "port blocked" error for the current platform * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::wasBlocked): ResourceHandleClient method to pass on the didFail(error) (WebCore::ResourceLoader::blockedError): Following the pattern of "CancelledError()", get the error to fail with for the didFail() call * loader/ResourceLoader.h: * platform/graphics/svg/SVGImageEmptyClients.h: (WebCore::SVGEmptyFrameLoaderClient::blockedError): Added stub * platform/network/ResourceHandle.cpp: (WebCore::ResourceHandle::create): If the port is blocked, create the handle but schedule it for deferred failure on a timer (WebCore::ResourceHandle::scheduleBlockedFailure): Do the timer scheduling (WebCore::ResourceHandle::fireBlockedFailure): Fire the timer here (WebCore::ResourceHandle::portAllowed): Implements checking of Mozilla's * platform/network/ResourceHandle.h: * platform/network/ResourceHandleClient.h: (WebCore::ResourceHandleClient::wasBlocked): Virtual for clients to get the "blocked" message WebKit: Reviewed by Maciej <rdar://problem/4429701> Implements a port blocking black list that matches Firefox's * English.lproj/Localizable.strings: Added localizable string for port blocked error code * Misc/WebKitErrors.h: * Misc/WebKitErrors.m: (registerErrors): Add new port blocked error code to WebKitErrorDomain * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::cancelledError): Fixed coding style (WebFrameLoaderClient::blockedError): Return a ResourceError with the new custom error code git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20227 268f45cc-cd09-0410-ab3c-d52691b4dbfc
d82d99fe