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: https://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 751d4c972f9a9e3d13c322d386f52c176bb0d9ca..862f7377722d7744c381405953f5c016310e30a8 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 8015c16c4113eab4af5b4708f77c4fbe5ef02197..d9c0d7b6f663be5a5c2ba673229300243e194bb1 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 43aad5fffb8cbd2e3f4a39dd23ec565e6996a34a..9679067e6dc7505b0f90401607967eaa3276dcfa 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()