Reviewed by Adam Roben.
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Feb 2011 22:47:03 +0000 (22:47 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Feb 2011 22:47:03 +0000 (22:47 +0000)
commit9226e5dedfd6f13dad56e09e2ac3d76637c65061
tree72ea328d57149c50d623d8633617744751032c0b
parent74b590164aa2d4cbdbb651972bb1a989ed6ecd61
    Reviewed by Adam Roben.

        REGRESSION (WebKit2): HTTP requests time out after 60 seconds
        https://bugs.webkit.org/show_bug.cgi?id=54755
        <rdar://problem/9006592>

WebCore:
        It's now possible to set a default timeout to be used at ResourceRequest creation. If one
        hasn't been set, ResourceRequest will behave as before (use NSURLRequest default on Mac,
        or use INT_MAX on other platforms).

        * WebCore.exp.in:
        * platform/network/ResourceRequestBase.cpp:
        (WebCore::ResourceRequestBase::defaultTimeoutInterval): Get the ResourceRequest notion of
        default timeout interval (may be 0 if using NSURLRequest default).
        (WebCore::ResourceRequestBase::setDefaultTimeoutInterval): Set the static member variable.
        (WebCore::ResourceRequestBase::updatePlatformRequest): Added an assertion that resource
        request is updated. Plaform code often calls updateResourceRequest() indirectly from this
        function, and that must obviously be a no-op.
        (WebCore::ResourceRequestBase::updateResourceRequest): Added an assertion in the opposite
        direction.
        * platform/network/ResourceRequestBase.h: Changed "unspecifiedTimeoutInterval" to
        "defaultTimeoutInterval". It has been used as default by most platforms anyway.
        (WebCore::ResourceRequestBase::ResourceRequestBase):

        * platform/network/mac/ResourceRequestMac.mm: (WebCore::ResourceRequest::doUpdatePlatformRequest):
        Now zero is the magic value, not INT_MAX. We'll use NSURLRequest default if neither
        setTimeoutInterval() nor setDefaultTimeoutInterval() has been called.

WebKit2:
        * Shared/API/c/WKURLRequest.cpp:
        (WKURLRequestSetDefaultTimeoutInterval):
        * Shared/API/c/WKURLRequest.h:
        Added an API to set a default timeout interval for requests created from URLs. The API
        affects both the UI process and requests created internally by the Web process. Requests
        created from NSURLRequest or CFURLRequest take timeout from those.

        * Shared/WebURLRequest.cpp: (WebKit::WebURLRequest::setDefaultTimeoutInterval):
        * Shared/WebURLRequest.h:
        Pipe the default timeout interval from WKURLRequest down to actual implementation. Since
        WebURLRequest is currently implemented with WebCore::ResourceRequest, it automatically respects
        NSURLRequest default timeout interval.

        * UIProcess/WebProcessManager.cpp: (WebKit::WebProcessManager::getAllWebProcessContexts):
        * UIProcess/WebProcessManager.h:
        Added a way to enumerate all contexts running in separate processes.

        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
        (WebKit::WebProcessCreationParameters::encode):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        (WebKit::WebContext::ensureWebProcess):
        (WebKit::WebContext::setDefaultRequestTimeoutInterval):
        * UIProcess/WebContext.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):
        (WebKit::WebProcess::setDefaultRequestTimeoutInterval):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:
        Use UI process default timeout interval in separate process contexts, too.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@79253 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/network/ResourceRequestBase.cpp
Source/WebCore/platform/network/ResourceRequestBase.h
Source/WebCore/platform/network/mac/ResourceRequestMac.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/API/c/WKURLRequest.cpp
Source/WebKit2/Shared/API/c/WKURLRequest.h
Source/WebKit2/Shared/WebProcessCreationParameters.cpp
Source/WebKit2/Shared/WebProcessCreationParameters.h
Source/WebKit2/Shared/WebURLRequest.cpp
Source/WebKit2/Shared/WebURLRequest.h
Source/WebKit2/UIProcess/WebContext.cpp
Source/WebKit2/UIProcess/WebContext.h
Source/WebKit2/UIProcess/WebProcessManager.cpp
Source/WebKit2/UIProcess/WebProcessManager.h
Source/WebKit2/WebProcess/WebProcess.cpp
Source/WebKit2/WebProcess/WebProcess.h
Source/WebKit2/WebProcess/WebProcess.messages.in