LayoutTests:
authorbeidson <beidson@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Mar 2007 03:12:27 +0000 (03:12 +0000)
committerbeidson <beidson@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Mar 2007 03:12:27 +0000 (03:12 +0000)
commit8dc8c5772470fd8e26575f146035a2cb62ffe8eb
tree06e9397a4b8dd05f28b5726d915469cf182305bb
parent2ec344913bea1a0c1009c93b734eb939638c6e25
LayoutTests:

        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: https://svn.webkit.org/repository/webkit/trunk@20227 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
LayoutTests/ChangeLog
LayoutTests/security/block-test-expected.txt [new file with mode: 0644]
LayoutTests/security/block-test.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/loader/FrameLoader.cpp
WebCore/loader/FrameLoader.h
WebCore/loader/FrameLoaderClient.h
WebCore/loader/ResourceLoader.cpp
WebCore/loader/ResourceLoader.h
WebCore/platform/graphics/svg/SVGImageEmptyClients.h
WebCore/platform/network/ResourceHandle.cpp
WebCore/platform/network/ResourceHandle.h
WebCore/platform/network/ResourceHandleClient.h
WebKit/ChangeLog
WebKit/English.lproj/Localizable.strings
WebKit/Misc/WebKitErrors.m
WebKit/Misc/WebKitErrorsPrivate.h
WebKit/WebCoreSupport/WebFrameLoaderClient.h
WebKit/WebCoreSupport/WebFrameLoaderClient.mm