Changeset 167406 in webkit


Ignore:
Timestamp:
Apr 16, 2014 5:56:35 PM (10 years ago)
Author:
Brian Burg
Message:

Web Replay: memoize fallback time values for document.lastModified
https://bugs.webkit.org/show_bug.cgi?id=131318

Reviewed by Joseph Pecoraro.

Source/WebCore:
If a document's Last-Modified header can't be found or used, then
document.lastModified is derived from the current system time or
from filesystem data, which is obviously nondeterministic.

It's better to handle this inside Document::lastModified rather than using
MemoizedDOMResult, because only the fallback case is nondeterministic.

Test: http/tests/inspector/replay/document-last-modified-fallback-value.html

The test is skipped for now, as it will be very flaky without the
functionality introduced by bugs 130728 and 129391.

  • dom/Document.cpp:

(WebCore::Document::lastModified): Save or reuse memoized fallback value.

  • replay/WebInputs.json: Add input DocumentLastModifiedDate.

LayoutTests:
Mark the new test as skipped until dependent functionality is landed.

  • http/tests/inspector/replay/document-last-modified-fallback-value.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r167402 r167406  
     12014-04-16  Brian J. Burg  <burg@cs.washington.edu>
     2
     3        Web Replay: memoize fallback time values for document.lastModified
     4        https://bugs.webkit.org/show_bug.cgi?id=131318
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        Mark the new test as skipped until dependent functionality is landed.
     9
     10        * http/tests/inspector/replay/document-last-modified-fallback-value.html: Added.
     11
    1122014-04-16  Dean Jackson  <dino@apple.com>
    213
  • trunk/LayoutTests/TestExpectations

    r167322 r167406  
    100100webkit.org/b/131679 inspector/dom/content-flow-list.html [ Skip ]
    101101webkit.org/b/131679 inspector/dom/content-flow-content-removal.html [ Skip ]
     102
     103# Doesn't work yet, relies on network replay functionality (webkit.org/b/130728, webkit.org/b/129391)
     104webkit.org/b/131318 http/tests/inspector/replay/document-last-modified-fallback-value.html [ Skip ]
  • trunk/Source/WebCore/ChangeLog

    r167404 r167406  
     12014-04-16  Brian J. Burg  <burg@cs.washington.edu>
     2
     3        Web Replay: memoize fallback time values for document.lastModified
     4        https://bugs.webkit.org/show_bug.cgi?id=131318
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        If a document's Last-Modified header can't be found or used, then
     9        document.lastModified is derived from the current system time or
     10        from filesystem data, which is obviously nondeterministic.
     11
     12        It's better to handle this inside Document::lastModified rather than using
     13        MemoizedDOMResult, because only the fallback case is nondeterministic.
     14
     15        Test: http/tests/inspector/replay/document-last-modified-fallback-value.html
     16
     17        The test is skipped for now, as it will be very flaky without the
     18        functionality introduced by bugs 130728 and 129391.
     19
     20        * dom/Document.cpp:
     21        (WebCore::Document::lastModified): Save or reuse memoized fallback value.
     22        * replay/WebInputs.json: Add input DocumentLastModifiedDate.
     23
    1242014-04-16  David Hyatt  <hyatt@apple.com>
    225
  • trunk/Source/WebCore/dom/Document.cpp

    r167299 r167406  
    221221
    222222#if ENABLE(WEB_REPLAY)
     223#include "WebReplayInputs.h"
    223224#include <replay/EmptyInputCursor.h>
    224225#endif
     
    38923893    // specificiation tells us to read the last modification date from the file
    38933894    // system.
    3894     if (!foundDate)
    3895         date.setMillisecondsSinceEpochForDateTime(currentTimeMS());
     3895    if (!foundDate) {
     3896        double fallbackDate = currentTimeMS();
     3897#if ENABLE(WEB_REPLAY)
     3898        InputCursor& cursor = inputCursor();
     3899        if (cursor.isCapturing())
     3900            cursor.appendInput<DocumentLastModifiedDate>(fallbackDate);
     3901        else if (cursor.isReplaying()) {
     3902            if (DocumentLastModifiedDate* input = cursor.fetchInput<DocumentLastModifiedDate>())
     3903                fallbackDate = input->fallbackValue();
     3904        }
     3905#endif
     3906        date.setMillisecondsSinceEpochForDateTime(fallbackDate);
     3907    }
     3908
    38963909    return String::format("%02d/%02d/%04d %02d:%02d:%02d", date.month() + 1, date.monthDay(), date.fullYear(), date.hour(), date.minute(), date.second());
    38973910}
  • trunk/Source/WebCore/replay/WebInputs.json

    r167299 r167406  
    166166        },
    167167        {
     168            "name": "DocumentLastModifiedDate",
     169            "description": "A fallback value used for the document's last modified date if the Last-Modified header can't be found or used.",
     170            "queue": "SCRIPT_MEMOIZED",
     171            "members": [
     172                { "name": "fallbackValue", "type": "double" }
     173            ]
     174        },
     175        {
    168176            "name": "EndSegmentSentinel",
    169177            "description": "A sentinel input to signal the end of a segment.",
Note: See TracChangeset for help on using the changeset viewer.