Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js

Issue 2122353002: [DevTools] Make resource tree model optional (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 { 186 {
187 if (!WebInspector.moduleSetting("preserveConsoleLog").get()) 187 if (!WebInspector.moduleSetting("preserveConsoleLog").get())
188 return; 188 return;
189 var frame = /** @type {!WebInspector.ResourceTreeFrame} */(event.data); 189 var frame = /** @type {!WebInspector.ResourceTreeFrame} */(event.data);
190 WebInspector.console.log(WebInspector.UIString("Navigated to %s", frame. url)); 190 WebInspector.console.log(WebInspector.UIString("Navigated to %s", frame. url));
191 }, 191 },
192 192
193 _initConsoleMessages: function() 193 _initConsoleMessages: function()
194 { 194 {
195 var mainTarget = WebInspector.targetManager.mainTarget(); 195 var mainTarget = WebInspector.targetManager.mainTarget();
196 if (!mainTarget || !mainTarget.resourceTreeModel.cachedResourcesLoaded() ) { 196 var cachedResources = false;
pfeldman 2016/07/07 17:44:14 Same, we need to fix it.
eostroukhov-old 2016/07/13 23:30:59 Out of scope for this refactoring?
197 if (mainTarget) {
198 var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(ma inTarget);
199 cachedResources = resourceTreeModel && resourceTreeModel.cachedResou rcesLoaded();
200 }
201 if (cachedResources) {
202 this._fetchMultitargetMessages();
203 } else {
197 WebInspector.targetManager.addModelListener(WebInspector.ResourceTre eModel, WebInspector.ResourceTreeModel.EventTypes.CachedResourcesLoaded, this._o nResourceTreeModelLoaded, this); 204 WebInspector.targetManager.addModelListener(WebInspector.ResourceTre eModel, WebInspector.ResourceTreeModel.EventTypes.CachedResourcesLoaded, this._o nResourceTreeModelLoaded, this);
198 return;
199 } 205 }
200 this._fetchMultitargetMessages();
201 }, 206 },
202 207
203 /** 208 /**
204 * @param {!WebInspector.Event} event 209 * @param {!WebInspector.Event} event
205 */ 210 */
206 _onResourceTreeModelLoaded: function(event) 211 _onResourceTreeModelLoaded: function(event)
207 { 212 {
208 var resourceTreeModel = event.target; 213 var resourceTreeModel = event.target;
209 if (resourceTreeModel.target() !== WebInspector.targetManager.mainTarget ()) 214 if (resourceTreeModel.target() !== WebInspector.targetManager.mainTarget ())
210 return; 215 return;
(...skipping 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after
1342 return true; 1347 return true;
1343 } 1348 }
1344 return false; 1349 return false;
1345 } 1350 }
1346 } 1351 }
1347 1352
1348 /** 1353 /**
1349 * @typedef {{messageIndex: number, matchIndex: number}} 1354 * @typedef {{messageIndex: number, matchIndex: number}}
1350 */ 1355 */
1351 WebInspector.ConsoleView.RegexMatchRange; 1356 WebInspector.ConsoleView.RegexMatchRange;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698