inspector.js is quite overcrowded, getting search logic moved to a separate class might get it a bit more readable.
Created attachment 83332 [details] patch
Comment on attachment 83332 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=83332&action=review > Source/WebCore/inspector/front-end/Object.js:92 > +WebInspector.declareSingleton = function(constructor) I don't see why search controller is different from domAgent, debuggerAgent, etc. We should simply initialize it onload. > Source/WebCore/inspector/front-end/ScriptsPanel.js:-1029 > - WebInspector.updateSearchMatchesCount(0, this); I think this call is still needed. > Source/WebCore/inspector/front-end/SearchController.js:198 > + for (var panelName in this.panels) { I don't think your controller has panels. Please test this change thoroughly. > Source/WebCore/inspector/front-end/SearchController.js:224 > + this.currentQuery = query; Could you encapsulate this?
Created attachment 83677 [details] patch
(In reply to comment #2) > (From update of attachment 83332 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=83332&action=review > > > Source/WebCore/inspector/front-end/Object.js:92 > > +WebInspector.declareSingleton = function(constructor) > > I don't see why search controller is different from domAgent, debuggerAgent, etc. We should simply initialize it onload. done. > > > Source/WebCore/inspector/front-end/ScriptsPanel.js:-1029 > > - WebInspector.updateSearchMatchesCount(0, this); > > I think this call is still needed. Yup, indeed -- we're still calling it directly. Brought it back. > > Source/WebCore/inspector/front-end/SearchController.js:198 > > + for (var panelName in this.panels) { > > I don't think your controller has panels. Please test this change thoroughly. Thanks, fixed! > > > Source/WebCore/inspector/front-end/SearchController.js:224 > > + this.currentQuery = query; > > Could you encapsulate this? done.
Comment on attachment 83677 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=83677&action=review > Source/WebCore/WebCore.gypi:4772 > + 'inspector/front-end/SearchController.js', Sc < Se > Source/WebCore/WebCore.vcproj/WebCore.vcproj:66104 > + RelativePath="..\inspector\front-end\SearchController.js" ditto > Source/WebCore/inspector/front-end/inspector.js:244 > + if (!this._initializationComplete) Why do we need this?
(In reply to comment #5) > (From update of attachment 83677 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=83677&action=review > > > Source/WebCore/WebCore.gypi:4772 > > + 'inspector/front-end/SearchController.js', > > Sc < Se > > > Source/WebCore/WebCore.vcproj/WebCore.vcproj:66104 > > + RelativePath="..\inspector\front-end\SearchController.js" > > ditto > > > Source/WebCore/inspector/front-end/inspector.js:244 > > + if (!this._initializationComplete) > > Why do we need this? we create bulk of WebInspector objects in doLoadedDone, and set attached() is occasionally called before that. We used to check for individual fields there, but as their number is growing, I thought we'd better replace it with a single check for initialization being complete (thought we discussed it).
Created attachment 83788 [details] patch - removed calls to resize() methods from set attached() (resize is supposed to be called along with set attached() in case we change attach mode) - fixed files ordering
Manually committed r80102: http://trac.webkit.org/changeset/80102