Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
| 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 | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 180 }, | 180 }, |
| 181 | 181 |
| 182 _consoleHistoryAutocompleteChanged: function() | 182 _consoleHistoryAutocompleteChanged: function() |
| 183 { | 183 { |
| 184 this._prompt.setAddCompletionsFromHistory(this._consoleHistoryAutocomple teSetting.get()); | 184 this._prompt.setAddCompletionsFromHistory(this._consoleHistoryAutocomple teSetting.get()); |
| 185 }, | 185 }, |
| 186 | 186 |
| 187 _initConsoleMessages: function() | 187 _initConsoleMessages: function() |
| 188 { | 188 { |
| 189 var mainTarget = WebInspector.targetManager.mainTarget(); | 189 var mainTarget = WebInspector.targetManager.mainTarget(); |
| 190 if (!mainTarget || !mainTarget.resourceTreeModel.cachedResourcesLoaded() ) { | 190 var cachedResources = false; |
| 191 if (mainTarget) { | |
| 192 var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(ma inTarget); | |
| 193 cachedResources = resourceTreeModel && resourceTreeModel.cachedResou rcesLoaded(); | |
|
dgozman
2016/08/19 20:23:37
cachedResources should be true when there is no ma
eostroukhov
2016/08/20 01:22:30
Done.
| |
| 194 } | |
| 195 if (cachedResources) { | |
| 196 this._fetchMultitargetMessages(); | |
| 197 } else { | |
| 191 WebInspector.targetManager.addModelListener(WebInspector.ResourceTre eModel, WebInspector.ResourceTreeModel.EventTypes.CachedResourcesLoaded, this._o nResourceTreeModelLoaded, this); | 198 WebInspector.targetManager.addModelListener(WebInspector.ResourceTre eModel, WebInspector.ResourceTreeModel.EventTypes.CachedResourcesLoaded, this._o nResourceTreeModelLoaded, this); |
| 192 return; | |
| 193 } | 199 } |
| 194 this._fetchMultitargetMessages(); | |
| 195 }, | 200 }, |
| 196 | 201 |
| 197 /** | 202 /** |
| 198 * @param {!WebInspector.Event} event | 203 * @param {!WebInspector.Event} event |
| 199 */ | 204 */ |
| 200 _onResourceTreeModelLoaded: function(event) | 205 _onResourceTreeModelLoaded: function(event) |
| 201 { | 206 { |
| 202 var resourceTreeModel = event.target; | 207 var resourceTreeModel = event.target; |
| 203 if (resourceTreeModel.target() !== WebInspector.targetManager.mainTarget ()) | 208 if (resourceTreeModel.target() !== WebInspector.targetManager.mainTarget ()) |
| 204 return; | 209 return; |
| (...skipping 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1412 return true; | 1417 return true; |
| 1413 } | 1418 } |
| 1414 return false; | 1419 return false; |
| 1415 } | 1420 } |
| 1416 } | 1421 } |
| 1417 | 1422 |
| 1418 /** | 1423 /** |
| 1419 * @typedef {{messageIndex: number, matchIndex: number}} | 1424 * @typedef {{messageIndex: number, matchIndex: number}} |
| 1420 */ | 1425 */ |
| 1421 WebInspector.ConsoleView.RegexMatchRange; | 1426 WebInspector.ConsoleView.RegexMatchRange; |
| OLD | NEW |