Changeset 95401 in webkit


Ignore:
Timestamp:
Sep 18, 2011 10:34:39 PM (13 years ago)
Author:
loislo@chromium.org
Message:

Web Inspector: chromium-win: "Save timeline data" does nothing.
https://bugs.webkit.org/show_bug.cgi?id=68313

windows shell API function GetSaveFileName doesn't accept file names with ':' symbol.

Reviewed by Pavel Feldman.

  • inspector/front-end/TimelinePanel.js:

(WebInspector.TimelineModel.prototype._saveToFile):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r95396 r95401  
     12011-09-18  Ilya Tikhonovsky  <loislo@chromium.org>
     2
     3        Web Inspector: chromium-win: "Save timeline data" does nothing.
     4        https://bugs.webkit.org/show_bug.cgi?id=68313
     5
     6        windows shell API function GetSaveFileName doesn't accept file names with ':' symbol.
     7
     8        Reviewed by Pavel Feldman.
     9
     10        * inspector/front-end/TimelinePanel.js:
     11        (WebInspector.TimelineModel.prototype._saveToFile):
     12
    1132011-09-18  Dan Bernstein  <mitz@apple.com>
    214
  • trunk/Source/WebCore/inspector/front-end/TimelinePanel.js

    r95383 r95401  
    13511351
    13521352        var now= new Date();
    1353         InspectorFrontendHost.saveAs("TimelineRawData-" + now.toRFC3339() + ".json", records.join(",\n"));
     1353        var suggestedFileName = "TimelineRawData-" + now.toISO8601Compact() + ".json";
     1354        InspectorFrontendHost.saveAs(suggestedFileName, records.join(",\n"));
    13541355    },
    13551356
  • trunk/Source/WebCore/inspector/front-end/utilities.js

    r94754 r95401  
    536536}
    537537
    538 Date.prototype.toRFC3339 = function()
     538Date.prototype.toISO8601Compact = function()
    539539{
    540540    function leadZero(x)
     
    542542        return x > 9 ? x : '0' + x
    543543    }
    544     var offset = Math.abs(this.getTimezoneOffset());
    545     var offsetString = Math.floor(offset / 60) + ':' + leadZero(offset % 60);
    546     return this.getFullYear() + '-' +
    547            leadZero(this.getMonth() + 1) + '-' +
     544    return this.getFullYear() +
     545           leadZero(this.getMonth() + 1) +
    548546           leadZero(this.getDate()) + 'T' +
    549            leadZero(this.getHours()) + ':' +
    550            leadZero(this.getMinutes()) + ':' +
    551            leadZero(this.getSeconds()) +
    552            (!offset ? "Z" : (this.getTimezoneOffset() > 0 ? '-' : '+') + offsetString);
     547           leadZero(this.getHours()) +
     548           leadZero(this.getMinutes()) +
     549           leadZero(this.getSeconds());
    553550}
    554551
Note: See TracChangeset for help on using the changeset viewer.