Reviewed by Darin.
authorap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Jun 2006 05:17:14 +0000 (05:17 +0000)
committerap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Jun 2006 05:17:14 +0000 (05:17 +0000)
commit098d00177937b13aa04349654cd256fc5cc07b2c
tree2fbce0902f36df2c72c307dc4202a3fa60c5d79b
parentf6b86c006b8e2218b3b45d0bfd26b566826dce7b
    Reviewed by Darin.

        - http://bugzilla.opendarwin.org/show_bug.cgi?id=5499
        Page reload does not send any cache control headers

WebCore:
        * bindings/js/kjs_window.cpp:
        (KJS::LocationFunc::callAsFunction): Call scheduleRefresh() for Location::Reload.

        * page/Frame.h: Add scheduleRefresh(). Don't derive from TransferJob or implement its methods - that was
        used only for storing response HTTP headers, which was an overkill.

        * page/FramePrivate.h: Replace TransferJob with a HashMap for storing response headers.

        * page/Frame.cpp:
        (WebCore::Frame::didOpenURL): Don't needlessly change d->m_cachePolicy. Don't create a TransferJob.
        (WebCore::Frame::stopLoading): Directly access the metadata map, instead of going through a TransferJob.
        (WebCore::Frame::receivedFirstData): Ditto.
        (WebCore::Frame::addMetaData): Ditto.
        (WebCore::Frame::scheduleRefresh): A new function that schedules a refresh, similarly to what
        scheduleRedirection() does.
        (WebCore::Frame::changeLocation): Set request.reload attribute based on the current cache policy.

WebKit:
        * WebView/WebFrame.m:
        (-[WebFrame _addExtraFieldsToRequest:mainResource:alwaysFromRequest:]): Set a proper Cache-Control header for
        reload requests.
        (-[WebFrame loadRequest:]): Reset loadType to WebFrameLoadTypeStandard (after a reload, it stayed at
        WebFrameLoadTypeReload, so _addExtraFieldsToRequest erroneously added a Cache-Control header to them).

LayoutTests:
        * http/tests/misc/refresh-headers-expected.txt: Added.
        * http/tests/misc/refresh-headers.php: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/misc/refresh-headers-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/misc/refresh-headers.php [new file with mode: 0644]
WebCore/ChangeLog
WebCore/bindings/js/kjs_window.cpp
WebCore/page/Frame.cpp
WebCore/page/Frame.h
WebCore/page/FramePrivate.h
WebKit/ChangeLog
WebKit/WebView/WebFrame.m