Title: [141561] trunk/Source/WebCore
Revision
141561
Author
aand...@chromium.org
Date
2013-02-01 01:52:10 -0800 (Fri, 01 Feb 2013)

Log Message

Web Inspector: [Canvas] drop trace log in the backend when deleting profile in frontend
https://bugs.webkit.org/show_bug.cgi?id=108591

Reviewed by Pavel Feldman.

Send a dropTraceLog command to the backend when deleting a profile header from the sidebar.
Before we were sending the command only upon deleting an existing view of a profile, so we  would not
sent the command if the view was not created or if a profile header was removed via context menu (the ondelete() method).
Drive-by: fixed an odd formatting of property functions.

* inspector/front-end/CanvasProfileView.js:
(WebInspector.CanvasProfileView.prototype.dispose):
(WebInspector.CanvasProfileHeader.prototype.reset):
* inspector/front-end/ProfilesPanel.js:
(WebInspector.ProfileHeader.prototype.reset):
(WebInspector.ProfileHeader.prototype.load):
(WebInspector.ProfileHeader.prototype.canSaveToFile):
(WebInspector.ProfileHeader.prototype.saveToFile):
(WebInspector.ProfileHeader.prototype.loadFromFile):
(WebInspector.ProfileHeader.prototype.fromFile):
(WebInspector.ProfilesPanel):
(WebInspector.ProfilesPanel.prototype._reset):
(WebInspector.ProfilesPanel.prototype._removeProfileHeader):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (141560 => 141561)


--- trunk/Source/WebCore/ChangeLog	2013-02-01 09:32:54 UTC (rev 141560)
+++ trunk/Source/WebCore/ChangeLog	2013-02-01 09:52:10 UTC (rev 141561)
@@ -1,3 +1,29 @@
+2013-02-01  Andrey Adaikin  <aand...@chromium.org>
+
+        Web Inspector: [Canvas] drop trace log in the backend when deleting profile in frontend
+        https://bugs.webkit.org/show_bug.cgi?id=108591
+
+        Reviewed by Pavel Feldman.
+
+        Send a dropTraceLog command to the backend when deleting a profile header from the sidebar.
+        Before we were sending the command only upon deleting an existing view of a profile, so we  would not
+        sent the command if the view was not created or if a profile header was removed via context menu (the ondelete() method).
+        Drive-by: fixed an odd formatting of property functions.
+
+        * inspector/front-end/CanvasProfileView.js:
+        (WebInspector.CanvasProfileView.prototype.dispose):
+        (WebInspector.CanvasProfileHeader.prototype.reset):
+        * inspector/front-end/ProfilesPanel.js:
+        (WebInspector.ProfileHeader.prototype.reset):
+        (WebInspector.ProfileHeader.prototype.load):
+        (WebInspector.ProfileHeader.prototype.canSaveToFile):
+        (WebInspector.ProfileHeader.prototype.saveToFile):
+        (WebInspector.ProfileHeader.prototype.loadFromFile):
+        (WebInspector.ProfileHeader.prototype.fromFile):
+        (WebInspector.ProfilesPanel):
+        (WebInspector.ProfilesPanel.prototype._reset):
+        (WebInspector.ProfilesPanel.prototype._removeProfileHeader):
+
 2013-02-01  Chris Fleizach  <cfleiz...@apple.com>
 
         AX: when aria-activedescendant is used with a ComboBox role, focus should not be changed

Modified: trunk/Source/WebCore/inspector/front-end/CanvasProfileView.js (141560 => 141561)


--- trunk/Source/WebCore/inspector/front-end/CanvasProfileView.js	2013-02-01 09:32:54 UTC (rev 141560)
+++ trunk/Source/WebCore/inspector/front-end/CanvasProfileView.js	2013-02-01 09:52:10 UTC (rev 141561)
@@ -103,7 +103,6 @@
     {
         this._logGridNodes = [];
         this._linkifier.reset();
-        CanvasAgent.dropTraceLog(this._traceLogId);
     },
 
     get statusBarItems()
@@ -767,6 +766,15 @@
     },
 
     /**
+     * @override
+     */
+    reset: function()
+    {
+        if (this._traceLogId)
+            CanvasAgent.dropTraceLog(this._traceLogId);
+    },
+
+    /**
      * @param {CanvasAgent.TraceLog=} traceLog
      */
     _updateCapturingStatus: function(traceLog)

Modified: trunk/Source/WebCore/inspector/front-end/ProfilesPanel.js (141560 => 141561)


--- trunk/Source/WebCore/inspector/front-end/ProfilesPanel.js	2013-02-01 09:32:54 UTC (rev 141560)
+++ trunk/Source/WebCore/inspector/front-end/ProfilesPanel.js	2013-02-01 09:52:10 UTC (rev 141561)
@@ -184,27 +184,45 @@
         throw new Error("Not implemented.");
     },
 
+    reset: function()
+    {
+    },
+
     /**
      * @param {Function} callback
      */
-    load: function(callback) { },
+    load: function(callback)
+    {
+    },
 
     /**
      * @return {boolean}
      */
-    canSaveToFile: function() { return false; },
+    canSaveToFile: function()
+    {
+        return false;
+    },
 
-    saveToFile: function() { throw new Error("Needs implemented"); },
+    saveToFile: function()
+    {
+        throw new Error("Needs implemented");
+    },
 
     /**
      * @param {File} file
      */
-    loadFromFile: function(file) { throw new Error("Needs implemented"); },
+    loadFromFile: function(file)
+    {
+        throw new Error("Needs implemented");
+    },
 
     /**
      * @return {boolean}
      */
-    fromFile: function() { return this._fromFile; }
+    fromFile: function()
+    {
+        return this._fromFile;
+    }
 }
 
 /**
@@ -264,6 +282,7 @@
     this._profileViewStatusBarItemsContainer = document.createElement("div");
     this._profileViewStatusBarItemsContainer.className = "status-bar-items";
 
+    /** @type {!Array.<!WebInspector.ProfileHeader>} */
     this._profiles = [];
     this._profilerEnabled = !Capabilities.profilerCausesRecompilation;
 
@@ -400,6 +419,7 @@
                 if ("dispose" in view)
                     view.dispose();
             }
+            this._profiles[i].reset();
         }
         delete this.visibleView;
 
@@ -594,6 +614,7 @@
             if (this._profiles[i].uid === profile.uid) {
                 profile = ""
                 this._profiles.splice(i, 1);
+                profile.reset();
                 break;
             }
         }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to