From 001c210e6e069e430fd5cc6cdfd754905de30959 Mon Sep 17 00:00:00 2001 From: "loislo@chromium.org" Date: Mon, 19 Sep 2011 05:34:39 +0000 Subject: [PATCH] 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): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95401 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebCore/ChangeLog | 12 ++++++++++++ Source/WebCore/inspector/front-end/TimelinePanel.js | 3 ++- Source/WebCore/inspector/front-end/utilities.js | 15 ++++++--------- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 751d4c9..862f737 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,15 @@ +2011-09-18 Ilya Tikhonovsky + + 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): + 2011-09-18 Dan Bernstein Try to fix the Chromium Mac build after r95391. diff --git a/Source/WebCore/inspector/front-end/TimelinePanel.js b/Source/WebCore/inspector/front-end/TimelinePanel.js index 8015c16..d9c0d7b 100644 --- a/Source/WebCore/inspector/front-end/TimelinePanel.js +++ b/Source/WebCore/inspector/front-end/TimelinePanel.js @@ -1350,7 +1350,8 @@ WebInspector.TimelineModel.prototype = { records[records.length - 1] = records[records.length - 1] + "]"; var now= new Date(); - InspectorFrontendHost.saveAs("TimelineRawData-" + now.toRFC3339() + ".json", records.join(",\n")); + var suggestedFileName = "TimelineRawData-" + now.toISO8601Compact() + ".json"; + InspectorFrontendHost.saveAs(suggestedFileName, records.join(",\n")); }, _reset: function() diff --git a/Source/WebCore/inspector/front-end/utilities.js b/Source/WebCore/inspector/front-end/utilities.js index 43aad5f..9679067 100644 --- a/Source/WebCore/inspector/front-end/utilities.js +++ b/Source/WebCore/inspector/front-end/utilities.js @@ -535,21 +535,18 @@ Number.constrain = function(num, min, max) return num; } -Date.prototype.toRFC3339 = function() +Date.prototype.toISO8601Compact = function() { function leadZero(x) { return x > 9 ? x : '0' + x } - var offset = Math.abs(this.getTimezoneOffset()); - var offsetString = Math.floor(offset / 60) + ':' + leadZero(offset % 60); - return this.getFullYear() + '-' + - leadZero(this.getMonth() + 1) + '-' + + return this.getFullYear() + + leadZero(this.getMonth() + 1) + leadZero(this.getDate()) + 'T' + - leadZero(this.getHours()) + ':' + - leadZero(this.getMinutes()) + ':' + - leadZero(this.getSeconds()) + - (!offset ? "Z" : (this.getTimezoneOffset() > 0 ? '-' : '+') + offsetString); + leadZero(this.getHours()) + + leadZero(this.getMinutes()) + + leadZero(this.getSeconds()); } HTMLTextAreaElement.prototype.moveCursorToEnd = function() -- 2.7.4