Changeset 80224 in webkit
- Timestamp:
- Mar 3, 2011 3:03:32 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r80223 r80224 1 2011-03-03 Pavel Podivilov <podivilov@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: rename "sourceName" to "sourceFileId" in ScriptsPanel.js. 6 https://bugs.webkit.org/show_bug.cgi?id=55569 7 8 * inspector/debugger/scripts-panel.html: 9 1 10 2011-03-03 Jeremy Moskovich <jeremy@chromium.org> 2 11 -
trunk/LayoutTests/inspector/debugger/scripts-panel.html
r79873 r80224 35 35 36 36 var sourceFrameCount = 0; 37 for (var source Name in panel._sourceNameToSourceFrame)37 for (var sourceFileId in panel._sourceFileIdToSourceFrame) 38 38 sourceFrameCount += 1; 39 39 InspectorTest.assertEquals(1, sourceFrameCount, "wrong number of source frames created during initial load"); -
trunk/Source/WebCore/ChangeLog
r80222 r80224 1 2011-03-03 Pavel Podivilov <podivilov@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: rename "sourceName" to "sourceFileId" in ScriptsPanel.js. 6 https://bugs.webkit.org/show_bug.cgi?id=55569 7 8 sourceFileId better reflects the intention to have unique identifier for each source that is shown in scripts panel. 9 10 * inspector/front-end/DebuggerPresentationModel.js: 11 * inspector/front-end/ScriptsPanel.js: 12 1 13 2011-03-03 Steve Block <steveblock@google.com> 2 14 -
trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js
r79311 r80224 45 45 46 46 WebInspector.DebuggerPresentationModel.prototype = { 47 breakpointsForSource Name: function(sourceName)47 breakpointsForSourceFileId: function(sourceFileId) 48 48 { 49 49 var breakpoints = []; 50 50 for (var id in this._breakpoints) { 51 51 var breakpoint = this._breakpoints[id]; 52 if (breakpoint.source Name === sourceName)52 if (breakpoint.sourceFileId === sourceFileId) 53 53 breakpoints.push(breakpoint); 54 54 } … … 62 62 var sourceLocation = this._actualLocationToSourceLocation(breakpoint.url || breakpoint.sourceID, location.lineNumber, location.columnNumber); 63 63 64 var encodedSourceLocation = this._encodeSourceLocation(sourceLocation.source Name, sourceLocation.lineNumber);64 var encodedSourceLocation = this._encodeSourceLocation(sourceLocation.sourceFileId, sourceLocation.lineNumber); 65 65 if (encodedSourceLocation in this._sourceLocationToBreakpointId) { 66 66 // We can't show more than one breakpoint on a single source frame line. Remove newly added breakpoint. … … 70 70 71 71 var presentationBreakpoint = { 72 source Name: sourceLocation.sourceName,72 sourceFileId: sourceLocation.sourceFileId, 73 73 lineNumber: sourceLocation.lineNumber, 74 74 url: breakpoint.url, … … 88 88 var breakpointId = event.data; 89 89 var breakpoint = this._breakpoints[breakpointId]; 90 var encodedSourceLocation = this._encodeSourceLocation(breakpoint.source Name, breakpoint.lineNumber);90 var encodedSourceLocation = this._encodeSourceLocation(breakpoint.sourceFileId, breakpoint.lineNumber); 91 91 delete this._breakpoints[breakpointId]; 92 92 delete this._sourceLocationToBreakpointId[encodedSourceLocation]; … … 101 101 }, 102 102 103 _encodeSourceLocation: function(source Name, lineNumber)103 _encodeSourceLocation: function(sourceFileId, lineNumber) 104 104 { 105 return source Name+ ":" + lineNumber;105 return sourceFileId + ":" + lineNumber; 106 106 }, 107 107 108 _actualLocationToSourceLocation: function(source Name, lineNumber, columnNumber)108 _actualLocationToSourceLocation: function(sourceID, lineNumber, columnNumber) 109 109 { 110 110 // TODO: use source mapping to obtain source location. 111 return { source Name: sourceName, lineNumber: lineNumber, columnNumber: columnNumber };111 return { sourceFileId: sourceID, lineNumber: lineNumber, columnNumber: columnNumber }; 112 112 } 113 113 } -
trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js
r80102 r80224 266 266 } 267 267 268 var source Name = this._sourceNameForScript(script);269 this._recreateSourceFrame(source Name);268 var sourceFileId = this._sourceFileIdForScript(script); 269 this._recreateSourceFrame(sourceFileId); 270 270 271 271 var callFrames = WebInspector.debuggerModel.callFrames; … … 288 288 289 289 // Add resource url to files select if not already added while debugging inlined scripts. 290 if (!(resource.url in this._source NameToFilesSelectOption))290 if (!(resource.url in this._sourceFileIdToFilesSelectOption)) 291 291 this._addOptionToFilesSelectAndShowSourceFrameIfNeeded(resource.url); 292 292 } else { … … 301 301 this._recreateSourceFrame(script.sourceURL); 302 302 } 303 } else if (!(script.sourceURL in this._source NameToFilesSelectOption)) {303 } else if (!(script.sourceURL in this._sourceFileIdToFilesSelectOption)) { 304 304 // This is a dynamic script with "//@ sourceURL=" comment. 305 305 this._addOptionToFilesSelectAndShowSourceFrameIfNeeded(script.sourceURL); … … 327 327 328 328 // Add resource url to files select if not already added while debugging inlined scripts. 329 if (!(resource.url in this._source NameToFilesSelectOption))329 if (!(resource.url in this._sourceFileIdToFilesSelectOption)) 330 330 this._addOptionToFilesSelectAndShowSourceFrameIfNeeded(resource.url); 331 331 }, … … 347 347 }, 348 348 349 _addOptionToFilesSelect: function(source Name)350 { 351 var script = this._scriptForSource Name(sourceName);349 _addOptionToFilesSelect: function(sourceFileId) 350 { 351 var script = this._scriptForSourceFileId(sourceFileId); 352 352 var select = this._filesSelectElement; 353 353 var option = document.createElement("option"); … … 367 367 select.insertBefore(option, select.childNodes.item(insertionIndex)); 368 368 369 option._source Name = sourceName;370 this._source NameToFilesSelectOption[sourceName] = option;369 option._sourceFileId = sourceFileId; 370 this._sourceFileIdToFilesSelectOption[sourceFileId] = option; 371 371 }, 372 372 … … 374 374 { 375 375 this._messages.push(message); 376 var sourceFrame = this._source NameToSourceFrame[message.url];376 var sourceFrame = this._sourceFileIdToSourceFrame[message.url]; 377 377 if (sourceFrame) 378 378 sourceFrame.addMessage(message); … … 382 382 { 383 383 this._messages = []; 384 for (var url in this._source NameToSourceFrame)385 this._source NameToSourceFrame[url].clearMessages();384 for (var url in this._sourceFileIdToSourceFrame) 385 this._sourceFileIdToSourceFrame[url].clearMessages(); 386 386 }, 387 387 … … 390 390 var breakpoint = event.data; 391 391 392 var sourceFrame = this._source NameToSourceFrame[breakpoint.sourceName];392 var sourceFrame = this._sourceFileIdToSourceFrame[breakpoint.sourceFileId]; 393 393 if (sourceFrame && sourceFrame.loaded) 394 394 sourceFrame.addBreakpoint(breakpoint.lineNumber, breakpoint.resolved, breakpoint.condition, breakpoint.enabled); … … 399 399 var breakpoint = event.data; 400 400 401 var sourceFrame = this._source NameToSourceFrame[breakpoint.sourceName];401 var sourceFrame = this._sourceFileIdToSourceFrame[breakpoint.sourceFileId]; 402 402 if (sourceFrame && sourceFrame.loaded) 403 403 sourceFrame.removeBreakpoint(breakpoint.lineNumber); … … 492 492 this._updateBackAndForwardButtons(); 493 493 494 this._source NameToSourceFrame = {};495 this._source NameToFilesSelectOption = {};494 this._sourceFileIdToSourceFrame = {}; 495 this._sourceFileIdToFilesSelectOption = {}; 496 496 this._messages = []; 497 497 this._filesSelectElement.removeChildren(); … … 525 525 canShowSourceLine: function(url, line) 526 526 { 527 return this._debuggerEnabled && (url in this._source NameToFilesSelectOption);527 return this._debuggerEnabled && (url in this._sourceFileIdToFilesSelectOption); 528 528 }, 529 529 530 530 showSourceLine: function(url, line) 531 531 { 532 if (!(url in this._source NameToFilesSelectOption))532 if (!(url in this._sourceFileIdToFilesSelectOption)) 533 533 return; 534 534 var sourceFrame = this._showSourceFrameAndAddToHistory(url); … … 547 547 }, 548 548 549 _showSourceFrameAndAddToHistory: function(source Name)550 { 551 var sourceFrame = this._showSourceFrame(source Name);549 _showSourceFrameAndAddToHistory: function(sourceFileId) 550 { 551 var sourceFrame = this._showSourceFrame(sourceFileId); 552 552 553 553 var oldIndex = this._currentBackForwardIndex; … … 557 557 // Check for a previous entry of the same object in _backForwardList. 558 558 // If one is found, remove it. 559 var previousEntryIndex = this._backForwardList.indexOf(source Name);559 var previousEntryIndex = this._backForwardList.indexOf(sourceFileId); 560 560 if (previousEntryIndex !== -1) 561 561 this._backForwardList.splice(previousEntryIndex, 1); 562 562 563 this._backForwardList.push(source Name);563 this._backForwardList.push(sourceFileId); 564 564 this._currentBackForwardIndex = this._backForwardList.length - 1; 565 565 … … 569 569 }, 570 570 571 _showSourceFrame: function(source Name)572 { 573 var index = this._source NameToFilesSelectOption[sourceName].index;571 _showSourceFrame: function(sourceFileId) 572 { 573 var index = this._sourceFileIdToFilesSelectOption[sourceFileId].index; 574 574 this._filesSelectElement.selectedIndex = index; 575 575 576 var sourceFrame = this._sourceFrameForSource Name(sourceName);576 var sourceFrame = this._sourceFrameForSourceFileId(sourceFileId); 577 577 this.visibleView = sourceFrame; 578 578 579 var script = this._scriptForSource Name(sourceName);579 var script = this._scriptForSourceFileId(sourceFileId); 580 580 if (script.sourceURL) 581 581 WebInspector.settings.lastViewedScriptFile = script.sourceURL; … … 584 584 }, 585 585 586 _sourceFrameForSource Name: function(sourceName)587 { 588 var sourceFrame = this._source NameToSourceFrame[sourceName];589 return sourceFrame || this._createSourceFrame(source Name);590 }, 591 592 _createSourceFrame: function(source Name)593 { 594 var script = this._scriptForSource Name(sourceName);586 _sourceFrameForSourceFileId: function(sourceFileId) 587 { 588 var sourceFrame = this._sourceFileIdToSourceFrame[sourceFileId]; 589 return sourceFrame || this._createSourceFrame(sourceFileId); 590 }, 591 592 _createSourceFrame: function(sourceFileId) 593 { 594 var script = this._scriptForSourceFileId(sourceFileId); 595 595 var contentProvider; 596 596 var isScript; … … 603 603 } 604 604 sourceFrame = new WebInspector.SourceFrame(contentProvider, script.sourceURL, isScript); 605 sourceFrame._source Name = sourceName;605 sourceFrame._sourceFileId = sourceFileId; 606 606 sourceFrame.addEventListener(WebInspector.SourceFrame.Events.Loaded, this._sourceFrameLoaded, this); 607 this._source NameToSourceFrame[sourceName] = sourceFrame;607 this._sourceFileIdToSourceFrame[sourceFileId] = sourceFrame; 608 608 return sourceFrame; 609 609 }, 610 610 611 _recreateSourceFrame: function(source Name)612 { 613 var oldSourceFrame = this._source NameToSourceFrame[sourceName];611 _recreateSourceFrame: function(sourceFileId) 612 { 613 var oldSourceFrame = this._sourceFileIdToSourceFrame[sourceFileId]; 614 614 if (!oldSourceFrame) 615 615 return; 616 616 oldSourceFrame.removeEventListener(WebInspector.SourceFrame.Events.Loaded, this._sourceFrameLoaded, this); 617 delete this._source NameToSourceFrame[sourceName];617 delete this._sourceFileIdToSourceFrame[sourceFileId]; 618 618 oldSourceFrame.removeEventListener(WebInspector.SourceFrame.Events.Loaded, this._sourceFrameLoaded, this); 619 619 if (this.visibleView !== oldSourceFrame) 620 620 return; 621 621 622 var newSourceFrame = this._createSourceFrame(source Name)622 var newSourceFrame = this._createSourceFrame(sourceFileId) 623 623 newSourceFrame.scrollTop = oldSourceFrame.scrollTop; 624 624 this.visibleView = newSourceFrame; … … 628 628 { 629 629 var sourceFrame = event.target; 630 var source Name = sourceFrame._sourceName;630 var sourceFileId = sourceFrame._sourceFileId; 631 631 632 632 for (var i = 0; i < this._messages.length; ++i) { 633 633 var message = this._messages[i]; 634 if (message.url === source Name)634 if (message.url === sourceFileId) 635 635 sourceFrame.addMessage(message); 636 636 } 637 637 638 var breakpoints = this._presentationModel.breakpointsForSource Name(sourceName);638 var breakpoints = this._presentationModel.breakpointsForSourceFileId(sourceFileId); 639 639 for (var i = 0; i < breakpoints.length; ++i) { 640 640 var breakpoint = breakpoints[i]; … … 645 645 if (selectedCallFrame) { 646 646 var script = WebInspector.debuggerModel.scriptForSourceID(selectedCallFrame.sourceID); 647 if (this._source NameForScript(script) === sourceName) {647 if (this._sourceFileIdForScript(script) === sourceFileId) { 648 648 sourceFrame.setExecutionLine(selectedCallFrame.line); 649 649 this._executionSourceFrame = sourceFrame; … … 652 652 }, 653 653 654 _source NameForScript: function(script)654 _sourceFileIdForScript: function(script) 655 655 { 656 656 return script.sourceURL || script.sourceID; 657 657 }, 658 658 659 _scriptForSource Name: function(sourceName)659 _scriptForSourceFileId: function(sourceFileId) 660 660 { 661 661 function filter(script) 662 662 { 663 return (script.sourceURL || script.sourceID) === source Name;663 return (script.sourceURL || script.sourceID) === sourceFileId; 664 664 } 665 665 return WebInspector.debuggerModel.queryScripts(filter)[0]; … … 686 686 687 687 var script = WebInspector.debuggerModel.scriptForSourceID(currentFrame.sourceID); 688 var source Name = this._sourceNameForScript(script);689 if (!(source Name in this._sourceNameToFilesSelectOption)) {688 var sourceFileId = this._sourceFileIdForScript(script); 689 if (!(sourceFileId in this._sourceFileIdToFilesSelectOption)) { 690 690 // This happens in two cases: 691 691 // 1) Current call frame function is defined in anonymous script (anonymous scripts aren't added to files select by default) 692 692 // 2) We are debugging synchronously executed inlined script and there is no resource so far 693 this._addOptionToFilesSelect(source Name);694 } 695 var sourceFrame = this._showSourceFrameAndAddToHistory(source Name);693 this._addOptionToFilesSelect(sourceFileId); 694 } 695 var sourceFrame = this._showSourceFrameAndAddToHistory(sourceFileId); 696 696 if (sourceFrame.loaded) { 697 697 sourceFrame.setExecutionLine(currentFrame.line); … … 702 702 _filesSelectChanged: function() 703 703 { 704 var source Name = this._filesSelectElement[this._filesSelectElement.selectedIndex]._sourceName;705 this._showSourceFrameAndAddToHistory(source Name);704 var sourceFileId = this._filesSelectElement[this._filesSelectElement.selectedIndex]._sourceFileId; 705 this._showSourceFrameAndAddToHistory(sourceFileId); 706 706 }, 707 707
Note: See TracChangeset
for help on using the changeset viewer.