Title: [87056] trunk/Source/WebCore
Revision
87056
Author
[email protected]
Date
2011-05-23 00:50:27 -0700 (Mon, 23 May 2011)

Log Message

2011-05-23  Mikhail Naganov  <[email protected]>

        Reviewed by Yury Semikhatsky.

        Web Inspector: [Chromium] Show "Please wait" message during initial
        heap snapshot processing.
        https://bugs.webkit.org/show_bug.cgi?id=61040

        * inspector/front-end/DetailedHeapshotView.js:
        (WebInspector.HeapSnapshotSortableDataGrid.prototype.sortingChanged.sort):
        (WebInspector.HeapSnapshotSortableDataGrid.prototype.sortingChanged):
        (WebInspector.DetailedHeapshotView.profileCallback):
        (WebInspector.DetailedHeapshotView.setDataSource):
        (WebInspector.DetailedHeapshotView):
        (WebInspector.DetailedHeapshotView.prototype._changeBase.baseProfileLoaded):
        (WebInspector.DetailedHeapshotView.prototype._changeBase.setDataSource):
        (WebInspector.DetailedHeapshotView.prototype._changeBase):
        (WebInspector.DetailedHeapshotView.prototype._changeView.setDataSource):
        (WebInspector.DetailedHeapshotView.prototype._changeView):
        * inspector/front-end/PleaseWaitMessage.js:
        (WebInspector.PleaseWaitMessage.prototype.showAndWaitFor):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (87055 => 87056)


--- trunk/Source/WebCore/ChangeLog	2011-05-23 07:11:46 UTC (rev 87055)
+++ trunk/Source/WebCore/ChangeLog	2011-05-23 07:50:27 UTC (rev 87056)
@@ -1,3 +1,25 @@
+2011-05-23  Mikhail Naganov  <[email protected]>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: [Chromium] Show "Please wait" message during initial
+        heap snapshot processing.
+        https://bugs.webkit.org/show_bug.cgi?id=61040
+
+        * inspector/front-end/DetailedHeapshotView.js:
+        (WebInspector.HeapSnapshotSortableDataGrid.prototype.sortingChanged.sort):
+        (WebInspector.HeapSnapshotSortableDataGrid.prototype.sortingChanged):
+        (WebInspector.DetailedHeapshotView.profileCallback):
+        (WebInspector.DetailedHeapshotView.setDataSource):
+        (WebInspector.DetailedHeapshotView):
+        (WebInspector.DetailedHeapshotView.prototype._changeBase.baseProfileLoaded):
+        (WebInspector.DetailedHeapshotView.prototype._changeBase.setDataSource):
+        (WebInspector.DetailedHeapshotView.prototype._changeBase):
+        (WebInspector.DetailedHeapshotView.prototype._changeView.setDataSource):
+        (WebInspector.DetailedHeapshotView.prototype._changeView):
+        * inspector/front-end/PleaseWaitMessage.js:
+        (WebInspector.PleaseWaitMessage.prototype.showAndWaitFor):
+
 2011-05-23  Adam Barth  <[email protected]>
 
         Strict PassOwnPtr build fixes.

Modified: trunk/Source/WebCore/inspector/front-end/DetailedHeapshotView.js (87055 => 87056)


--- trunk/Source/WebCore/inspector/front-end/DetailedHeapshotView.js	2011-05-23 07:11:46 UTC (rev 87055)
+++ trunk/Source/WebCore/inspector/front-end/DetailedHeapshotView.js	2011-05-23 07:50:27 UTC (rev 87056)
@@ -74,12 +74,11 @@
             return result;
         }
 
-        WebInspector.PleaseWaitMessage.prototype.showAndWaitFor(this.element, this, "sorting complete");
+        WebInspector.PleaseWaitMessage.prototype.showAndWaitFor(this.element, this, "sorting complete", sort.bind(this));
         function sort()
         {
             this._performSorting(SortByTwoFields);
         }
-        setTimeout(sort.bind(this), 0);
     },
 
     _performSorting: function(sortFunction)
@@ -605,6 +604,11 @@
             this.baseSelectElement.selectedIndex = profileIndex - 1;
         else
             this.baseSelectElement.selectedIndex = profileIndex;
+        WebInspector.PleaseWaitMessage.prototype.showAndWaitFor(this.currentView.element, this.dataGrid, "sorting complete", setDataSource.bind(this));
+    }
+
+    function setDataSource()
+    {
         this.dataGrid.setDataSource(this, this.profileWrapper); 
         this._updatePercentButton();
     }
@@ -839,7 +843,11 @@
         {
             delete this._baseProfileWrapper;
             this.baseProfile._lastShown = Date.now();
-            WebInspector.PleaseWaitMessage.prototype.showAndWaitFor(this.currentView.element, this.diffDataGrid, "sorting complete");
+            WebInspector.PleaseWaitMessage.prototype.showAndWaitFor(this.currentView.element, this.diffDataGrid, "sorting complete", setDataSource.bind(this));
+        }
+
+        function setDataSource()
+        {
             this.diffDataGrid.setBaseDataSource(this.baseProfileWrapper);
         }
 
@@ -959,12 +967,16 @@
             }
         } else {
             this.baseSelectElement.addStyleClass("hidden");
-            if (!this.dataGrid.snapshotView) {
-                WebInspector.PleaseWaitMessage.prototype.showAndWaitFor(this.currentView.element, this.dataGrid, "sorting complete");
-                this.dataGrid.setDataSource(this, this.profileWrapper);
-            }
+            if (!this.dataGrid.snapshotView)
+                WebInspector.PleaseWaitMessage.prototype.showAndWaitFor(this.currentView.element, this.dataGrid, "sorting complete", setDataSource.bind(this));
         }
 
+        function setDataSource()
+        {
+            this.dataGrid.setDataSource(this, this.profileWrapper);
+        }
+
+
         if (!this.currentQuery || !this._searchFinishedCallback || !this._searchResults)
             return;
 

Modified: trunk/Source/WebCore/inspector/front-end/PleaseWaitMessage.js (87055 => 87056)


--- trunk/Source/WebCore/inspector/front-end/PleaseWaitMessage.js	2011-05-23 07:11:46 UTC (rev 87055)
+++ trunk/Source/WebCore/inspector/front-end/PleaseWaitMessage.js	2011-05-23 07:50:27 UTC (rev 87056)
@@ -81,21 +81,23 @@
         element.appendChild(message);
     },
 
-    showAndWaitFor: function(element, listenObject, listenEvent)
+    showAndWaitFor: function(element, listenObject, listenEvent, action)
     {
         var instance = WebInspector.PleaseWaitMessage.prototype.instance;
         var message = instance.element;
-        if (message.parentNode === element)
-            return;
-
-        listenObject.addEventListener(listenEvent, WebInspector.PleaseWaitMessage.prototype.unlistenAndHide.bind(instance, listenObject, listenEvent), instance);
-        WebInspector.PleaseWaitMessage.prototype.show(element);
+        if (message.parentNode !== element) {
+            // If not already shown for this element.
+            listenObject.addEventListener(listenEvent, instance.unlistenAndHide.bind(instance, listenObject, listenEvent), instance);
+            WebInspector.PleaseWaitMessage.prototype.show(element);
+        }
+        if (action)
+            setTimeout(action, 0);
     },
 
     unlistenAndHide: function(listenObject, listenEvent)
     {
         var instance = WebInspector.PleaseWaitMessage.prototype.instance;
-        listenObject.removeEventListener(listenEvent, WebInspector.PleaseWaitMessage.prototype.unlistenAndHide, instance);
+        listenObject.removeEventListener(listenEvent, instance.unlistenAndHide, instance);
         WebInspector.PleaseWaitMessage.prototype.hide();
     }
 };
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to