| Differences between
and this patch
- LayoutTests/http/tests/cache/cancel-during-revalidation-succeeded.html +33 lines
Line 0 LayoutTests/http/tests/cache/cancel-during-revalidation-succeeded.html_sec1
1
<html>
2
<head>
3
<link id="img" rel="stylesheet" href="resources/stylesheet304.php">
4
</head>
5
<body>
6
It's possible for a successful revalidation to cause events to fire synchronously.
7
We shouldn't crash if one of those events stops the load.
8
See https://bugs.webkit.org/show_bug.cgi?id=72762.
9
<script>
10
if (window.layoutTestController) {
11
    layoutTestController.dumpAsText();
12
    layoutTestController.waitUntilDone();
13
}
14
15
function obl(e) {
16
    if (window.sessionStorage.getItem("reloaded")) {
17
        window.stop();
18
        window.sessionStorage.removeItem("reloaded");
19
        setTimeout(finish, 0);
20
    } else {
21
        window.sessionStorage.reloaded = "true";
22
        location.reload();
23
    }
24
}
25
26
function finish() {
27
    if (window.layoutTestController)
28
        layoutTestController.notifyDone();
29
}
30
</script>
31
<object type="application/x-no-such-mime" onbeforeload="obl();"></embed>
32
</body>
33
</html>
- LayoutTests/http/tests/cache/cancel-during-revalidation-succeeded-expected.txt +1 lines
Line 0 LayoutTests/http/tests/cache/cancel-during-revalidation-succeeded-expected.txt_sec1
1
It's possible for a successful revalidation to cause events to fire synchronously. We shouldn't crash if one of those events stops the load. See https://bugs.webkit.org/show_bug.cgi?id=72762.  
- LayoutTests/http/tests/cache/resources/stylesheet304.php +21 lines
Line 0 LayoutTests/http/tests/cache/resources/stylesheet304.php_sec1
1
<?php
2
require_once '../../resources/portabilityLayer.php';
3
4
clearstatcache();
5
6
if ($_SERVER["HTTP_IF_MODIFIED_SINCE"]) {
7
    header("HTTP/1.0 304 Not Modified");
8
    exit();
9
}
10
$one_year = 12 * 31 * 24 * 60 * 60;
11
$last_modified = gmdate(DATE_RFC1123, time() - $one_year);
12
$expires = gmdate(DATE_RFC1123, time() + $one_year);
13
14
header('Cache-Control: public, max-age=' . $one_year);
15
header('Expires: ' . $expires);
16
header('Content-Type: text/css');
17
header('Content-Length: 0');
18
header('Etag: 123456789');
19
header('Last-Modified: ' . $last_modified);
20
exit();
21
?>
- LayoutTests/ChangeLog +10 lines
Lines 1-3 LayoutTests/ChangeLog_sec1
1
2011-12-07  Nate Chapin  <japhet@chromium.org>
2
3
        Test for https://bugs.webkit.org/show_bug.cgi?id=72762
4
5
        Reviewed by NOBODY (OOPS!).
6
7
        * http/tests/cache/cancel-during-revalidation-succeeded-expected.txt: Added.
8
        * http/tests/cache/cancel-during-revalidation-succeeded.html: Added.
9
        * http/tests/cache/resources/stylesheet304.php: Added.
10
1
2011-12-07  James Simonsen  <simonjam@chromium.org>
11
2011-12-07  James Simonsen  <simonjam@chromium.org>
2
12
3
        [Chromium] Unreviewed, clean out passing tests from test_expectations.txt
13
        [Chromium] Unreviewed, clean out passing tests from test_expectations.txt
- Source/WebCore/ChangeLog +15 lines
Lines 1-3 Source/WebCore/ChangeLog_sec1
1
2011-12-07  Nate Chapin  <japhet@chromium.org>
2
3
        A SubresourceLoader in the middle of revalidating
4
        a resource should be treated as finishing (similar to
5
        didFinishLoading and didFail) to ensure that willCancel()
6
        doesn't declare the revalidation as having failed reentrantly.
7
        https://bugs.webkit.org/show_bug.cgi?id=72762
8
9
        Reviewed by NOBODY (OOPS!).
10
11
        Test: http/tests/cache/cancel-during-revalidation-succeeded.html
12
13
        * loader/SubresourceLoader.cpp:
14
        (WebCore::SubresourceLoader::didReceiveResponse):
15
1
2011-12-07  Andreas Kling  <kling@webkit.org>
16
2011-12-07  Andreas Kling  <kling@webkit.org>
2
17
3
        RenderObject::style(): Inline early-return condition.
18
        RenderObject::style(): Inline early-return condition.
- Source/WebCore/loader/SubresourceLoader.cpp -1 / +5 lines
Lines 148-155 Source/WebCore/loader/SubresourceLoader.cpp_sec1
148
        if (response.httpStatusCode() == 304) {
148
        if (response.httpStatusCode() == 304) {
149
            // 304 Not modified / Use local copy
149
            // 304 Not modified / Use local copy
150
            // Existing resource is ok, just use it updating the expiration time.
150
            // Existing resource is ok, just use it updating the expiration time.
151
            m_state = Finishing;
151
            memoryCache()->revalidationSucceeded(m_resource, response);
152
            memoryCache()->revalidationSucceeded(m_resource, response);
152
            ResourceLoader::didReceiveResponse(response);
153
            if (!reachedTerminalState()) {
154
                ResourceLoader::didReceiveResponse(response);
155
                cancel();
156
            }
153
            return;
157
            return;
154
        } 
158
        } 
155
        // Did not get 304 response, continue as a regular resource load.
159
        // Did not get 304 response, continue as a regular resource load.

Return to Bug 72762