Web Inspector: chromium-win: "Save timeline data" does nothing.
authorloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Sep 2011 05:34:39 +0000 (05:34 +0000)
committerloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Sep 2011 05:34:39 +0000 (05:34 +0000)
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
Source/WebCore/inspector/front-end/TimelinePanel.js
Source/WebCore/inspector/front-end/utilities.js

index 751d4c9..862f737 100644 (file)
@@ -1,3 +1,15 @@
+2011-09-18  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        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  <mitz@apple.com>
 
         Try to fix the Chromium Mac build after r95391.
index 8015c16..d9c0d7b 100644 (file)
@@ -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()
index 43aad5f..9679067 100644 (file)
@@ -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()