OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2012 Intel Inc. All rights reserved. | 3 * Copyright (C) 2012 Intel Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 _updateSearchResults: function(shouldJump, jumpBackwards) | 812 _updateSearchResults: function(shouldJump, jumpBackwards) |
813 { | 813 { |
814 var searchRegExp = this._searchRegex; | 814 var searchRegExp = this._searchRegex; |
815 if (!searchRegExp) | 815 if (!searchRegExp) |
816 return; | 816 return; |
817 | 817 |
818 var matches = []; | 818 var matches = []; |
819 | 819 |
820 /** | 820 /** |
821 * @param {!WebInspector.TimelineModel.Record} record | 821 * @param {!WebInspector.TimelineModel.Record} record |
| 822 * @this {WebInspector.TimelinePanel} |
822 */ | 823 */ |
823 function processRecord(record) | 824 function processRecord(record) |
824 { | 825 { |
| 826 if (record.endTime < this._windowStartTime || |
| 827 record.startTime > this._windowEndTime) |
| 828 return; |
825 if (record.testContentMatching(searchRegExp)) | 829 if (record.testContentMatching(searchRegExp)) |
826 matches.push(record); | 830 matches.push(record); |
827 } | 831 } |
828 this._model.forAllFilteredRecords(processRecord); | 832 this._model.forAllFilteredRecords(processRecord.bind(this)); |
829 | 833 |
830 var matchesCount = matches.length; | 834 var matchesCount = matches.length; |
831 if (matchesCount) { | 835 if (matchesCount) { |
832 this._searchResults = matches; | 836 this._searchResults = matches; |
833 this._searchableView.updateSearchMatchesCount(matchesCount); | 837 this._searchableView.updateSearchMatchesCount(matchesCount); |
834 | 838 |
835 var selectedIndex = matches.indexOf(this._selectedSearchResult); | 839 var selectedIndex = matches.indexOf(this._selectedSearchResult); |
836 if (shouldJump && selectedIndex === -1) | 840 if (shouldJump && selectedIndex === -1) |
837 selectedIndex = jumpBackwards ? this._searchResults.length - 1 :
0; | 841 selectedIndex = jumpBackwards ? this._searchResults.length - 1 :
0; |
838 this._selectSearchResult(selectedIndex); | 842 this._selectSearchResult(selectedIndex); |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1227 * @param {!WebInspector.TimelineModel.Record} record | 1231 * @param {!WebInspector.TimelineModel.Record} record |
1228 * @return {boolean} | 1232 * @return {boolean} |
1229 */ | 1233 */ |
1230 accept: function(record) | 1234 accept: function(record) |
1231 { | 1235 { |
1232 return !this._hiddenRecords[record.type]; | 1236 return !this._hiddenRecords[record.type]; |
1233 }, | 1237 }, |
1234 | 1238 |
1235 __proto__: WebInspector.TimelineModel.Filter.prototype | 1239 __proto__: WebInspector.TimelineModel.Filter.prototype |
1236 } | 1240 } |
OLD | NEW |