Changeset 52253 in webkit
- Timestamp:
- Dec 17, 2009 7:34:33 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r52251 r52253 1 2009-12-17 Mikhail Naganov <mnaganov@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Advice links to source code in CPU profiler to open in debugger, 6 not in resources tab. 7 8 Also work around the case when resources are disabled, but scripts are present. 9 10 https://bugs.webkit.org/show_bug.cgi?id=32610 11 12 * inspector/front-end/Panel.js: 13 (WebInspector.Panel.prototype.updateMainViewWidth): 14 (WebInspector.Panel.prototype.canShowSourceLineForURL): 15 (WebInspector.Panel.prototype.showSourceLineForURL): 16 * inspector/front-end/ProfileDataGridTree.js: 17 (WebInspector.ProfileDataGridNode.prototype.createCell): 18 * inspector/front-end/ResourcesPanel.js: 19 (WebInspector.ResourcesPanel.prototype.canShowSourceLineForURL): 20 (WebInspector.ResourcesPanel.prototype.showSourceLineForURL): 21 * inspector/front-end/ScriptsPanel.js: 22 (WebInspector.ScriptsPanel.prototype.scriptForURL): 23 (WebInspector.ScriptsPanel.prototype.canShowSourceLineForURL): 24 (WebInspector.ScriptsPanel.prototype.showSourceLineForURL): 25 (WebInspector.ScriptsPanel.prototype._showScriptOrResource): 26 * inspector/front-end/inspector.js: 27 (WebInspector.documentClick.followLink): 28 (WebInspector.documentClick): 29 (WebInspector._choosePanelToShowSourceLineForURL): 30 (WebInspector.canShowSourceLineForURL): 31 (WebInspector.showSourceLineForURL): 32 1 33 2009-12-15 Philippe Normand <pnormand@igalia.com> 2 34 -
trunk/WebCore/inspector/front-end/Panel.js
r52099 r52253 364 364 { 365 365 // Should be implemented by ancestors. 366 }, 367 368 canShowSourceLineForURL: function(url) 369 { 370 return false; 371 }, 372 373 showSourceLineForURL: function(url, line) 374 { 375 return false; 366 376 } 367 377 } -
trunk/WebCore/inspector/front-end/ProfileDataGridTree.js
r49891 r52253 103 103 urlElement.href = this.profileNode.url; 104 104 urlElement.lineNumber = this.profileNode.lineNumber; 105 urlElement.preferredPanel = "scripts"; 105 106 106 107 if (this.profileNode.lineNumber > 0) -
trunk/WebCore/inspector/front-end/ResourcesPanel.js
r51946 r52253 457 457 }, 458 458 459 canShowSourceLineForURL: function(url) 460 { 461 return !!WebInspector.resourceForURL(url); 462 }, 463 464 showSourceLineForURL: function(url, line) 465 { 466 this.showResource(WebInspector.resourceForURL(url), line); 467 }, 468 459 469 showResource: function(resource, line) 460 470 { -
trunk/WebCore/inspector/front-end/ScriptsPanel.js
r52099 r52253 311 311 }, 312 312 313 scriptForURL: function(url) 314 { 315 return this._scriptsForURLsInFilesSelect[url]; 316 }, 317 313 318 addBreakpoint: function(breakpoint) 314 319 { … … 498 503 }, 499 504 500 canShowResource: function(resource) 501 { 502 return resource && resource.scripts.length && InspectorBackend.debuggerEnabled(); 505 canShowSourceLineForURL: function(url) 506 { 507 return InspectorBackend.debuggerEnabled() && 508 !!(WebInspector.resourceForURL(url) || this.scriptForURL(url)); 509 }, 510 511 showSourceLineForURL: function(url, line) 512 { 513 var resource = WebInspector.resourceForURL(url); 514 if (resource) 515 this.showResource(resource, line); 516 else 517 this.showScript(this.scriptForURL(url), line); 503 518 }, 504 519 … … 652 667 console.assert(option); 653 668 } else { 654 var script = this. _scriptsForURLsInFilesSelect[url];669 var script = this.scriptForURL(url); 655 670 if (script) 656 671 option = script.filesSelectOption; -
trunk/WebCore/inspector/front-end/inspector.js
r52154 r52253 601 601 { 602 602 // FIXME: support webkit-html-external-link links here. 603 if ( anchor.href in WebInspector.resourceURLMap) {603 if (WebInspector.canShowSourceLineForURL(anchor.href, anchor.preferredPanel)) { 604 604 if (anchor.hasStyleClass("webkit-html-external-link")) { 605 605 anchor.removeStyleClass("webkit-html-external-link"); … … 607 607 } 608 608 609 WebInspector.show ResourceForURL(anchor.href, anchor.lineNumber, anchor.preferredPanel);609 WebInspector.showSourceLineForURL(anchor.href, anchor.lineNumber, anchor.preferredPanel); 610 610 } else { 611 611 var profileString = WebInspector.ProfileType.URLRegExp.exec(anchor.href); … … 1410 1410 } 1411 1411 1412 WebInspector.showResourceForURL = function(url, line, preferredPanel) 1413 { 1414 var resource = this.resourceForURL(url); 1415 if (!resource) 1416 return false; 1417 1418 if (preferredPanel && preferredPanel in WebInspector.panels) { 1419 var panel = this.panels[preferredPanel]; 1420 if (!("showResource" in panel)) 1421 panel = null; 1422 else if ("canShowResource" in panel && !panel.canShowResource(resource)) 1423 panel = null; 1424 } 1425 1426 this.currentPanel = panel || this.panels.resources; 1412 WebInspector._choosePanelToShowSourceLineForURL = function(url, preferredPanel) 1413 { 1414 preferredPanel = preferredPanel || "resources"; 1415 var panel = this.panels[preferredPanel]; 1416 if (panel && panel.canShowSourceLineForURL(url)) 1417 return panel; 1418 panel = this.panels.resources; 1419 return panel.canShowSourceLineForURL(url) ? panel : null; 1420 } 1421 1422 WebInspector.canShowSourceLineForURL = function(url, preferredPanel) 1423 { 1424 return !!this._choosePanelToShowSourceLineForURL(url, preferredPanel); 1425 } 1426 1427 WebInspector.showSourceLineForURL = function(url, line, preferredPanel) 1428 { 1429 this.currentPanel = this._choosePanelToShowSourceLineForURL(url, preferredPanel); 1427 1430 if (!this.currentPanel) 1428 1431 return false; 1429 this.currentPanel.show Resource(resource, line);1432 this.currentPanel.showSourceLineForURL(url, line); 1430 1433 return true; 1431 1434 }
Note: See TracChangeset
for help on using the changeset viewer.