Changeset 45131 in webkit


Ignore:
Timestamp:
Jun 24, 2009 6:52:46 PM (15 years ago)
Author:
eric@webkit.org
Message:

2009-06-24 Mikhail Naganov <mnaganov@chromium.org>

Reviewed by Timothy Hatcher.

Bug 26604: Search doesn't work in Web Inspector Profiler
https://bugs.webkit.org/show_bug.cgi?id=26604

Seems like search was damaged in revision 42808.

  • inspector/front-end/ProfileView.js: (WebInspector.ProfileView.prototype.refresh): Here and in other functions: nodes we're searching in are profile data grid nodes, so there is no more need for '_dataGridNode' references. (WebInspector.ProfileView.prototype.searchCanceled): (WebInspector.ProfileView.prototype.performSearch.matchesQuery): Fixed accidental semicolon that caused 'matchesQuery' always return true. (WebInspector.ProfileView.prototype.performSearch): To perform search correctly in the case of bottom up tree, we need to populate the tree, because there's no 1-to-1 correspondence between profile nodes and data grid nodes in this case. (WebInspector.ProfileView.prototype._jumpToSearchResult):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r45129 r45131  
     12009-06-24  Mikhail Naganov  <mnaganov@chromium.org>
     2
     3        Reviewed by Timothy Hatcher.
     4
     5        Bug 26604: Search doesn't work in Web Inspector Profiler
     6        https://bugs.webkit.org/show_bug.cgi?id=26604
     7
     8        Seems like search was damaged in revision 42808.
     9
     10        * inspector/front-end/ProfileView.js:
     11        (WebInspector.ProfileView.prototype.refresh):
     12        Here and in other functions: nodes we're searching in are profile data grid
     13        nodes, so there is no more need for '_dataGridNode' references.
     14        (WebInspector.ProfileView.prototype.searchCanceled):
     15        (WebInspector.ProfileView.prototype.performSearch.matchesQuery):
     16        Fixed accidental semicolon that caused 'matchesQuery' always return true.
     17        (WebInspector.ProfileView.prototype.performSearch):
     18        To perform search correctly in the case of bottom up tree, we need to populate
     19        the tree, because there's no 1-to-1 correspondence between profile nodes and
     20        data grid nodes in this case.
     21        (WebInspector.ProfileView.prototype._jumpToSearchResult):
     22
    1232009-06-24  Simon Fraser  <simon.fraser@apple.com>
    224
  • trunk/WebCore/inspector/front-end/ProfileView.js

    r42808 r45131  
    167167            this.dataGrid.appendChild(children[index]);
    168168
    169         if (selectedProfileNode && selectedProfileNode._dataGridNode)
    170             selectedProfileNode._dataGridNode.selected = true;
     169        if (selectedProfileNode)
     170            selectedProfileNode.selected = true;
    171171    },
    172172
     
    197197                delete profileNode._searchMatchedFunctionColumn;
    198198
    199                 if (profileNode._dataGridNode)
    200                     profileNode._dataGridNode.refresh();
     199                profileNode.refresh();
    201200            }
    202201        }
     
    314313                profileDataGridNode._searchMatchedAverageColumn ||
    315314                profileDataGridNode._searchMatchedCallsColumn ||
    316                 profileDataGridNode._searchMatchedFunctionColumn);
     315                profileDataGridNode._searchMatchedFunctionColumn)
    317316            {
    318317                profileDataGridNode.refresh();
     
    323322        }
    324323
    325         var current = this.dataGrid;
    326         var ancestors = [];
    327         var nextIndexes = [];
    328         var startIndex = 0;
     324        var current = this.profileDataGridTree.children[0];
    329325
    330326        while (current) {
    331             var children = current.children;
    332             var childrenLength = children.length;
    333 
    334             if (startIndex >= childrenLength) {
    335                 current = ancestors.pop();
    336                 startIndex = nextIndexes.pop();
    337                 continue;
     327            if (matchesQuery(current)) {
     328                this._searchResults.push({ profileNode: current });
    338329            }
    339330
    340             for (var i = startIndex; i < childrenLength; ++i) {
    341                 var child = children[i];
    342 
    343                 if (matchesQuery(child)) {
    344                     if (child._dataGridNode) {
    345                         // The child has a data grid node already, no need to remember the ancestors.
    346                         this._searchResults.push({ profileNode: child });
    347                     } else {
    348                         var ancestorsCopy = [].concat(ancestors);
    349                         ancestorsCopy.push(current);
    350                         this._searchResults.push({ profileNode: child, ancestors: ancestorsCopy });
    351                     }
    352                 }
    353 
    354                 if (child.children.length) {
    355                     ancestors.push(current);
    356                     nextIndexes.push(i + 1);
    357                     current = child;
    358                     startIndex = 0;
    359                     break;
    360                 }
    361 
    362                 if (i === (childrenLength - 1)) {
    363                     current = ancestors.pop();
    364                     startIndex = nextIndexes.pop();
    365                 }
    366             }
     331            current = current.traverseNextNode(false, null, false);
    367332        }
    368333
     
    420385            return;
    421386
    422         var profileNode = this._searchResults[index].profileNode;
    423         if (!profileNode._dataGridNode && searchResult.ancestors) {
    424             var ancestors = searchResult.ancestors;
    425             for (var i = 0; i < ancestors.length; ++i) {
    426                 var ancestorProfileNode = ancestors[i];
    427                 var gridNode = ancestorProfileNode._dataGridNode;
    428                 if (gridNode)
    429                     gridNode.expand();
    430             }
    431 
    432             // No need to keep the ancestors around.
    433             delete searchResult.ancestors;
    434         }
    435 
    436         gridNode = profileNode._dataGridNode;
    437         if (!gridNode)
    438             return;
    439 
    440         gridNode.reveal();
    441         gridNode.select();
     387        var profileNode = searchResult.profileNode;
     388        profileNode.reveal();
     389        profileNode.select();
    442390    },
    443391
Note: See TracChangeset for help on using the changeset viewer.