Changeset 172204 in webkit
- Timestamp:
- Aug 6, 2014 11:23:14 PM (10 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r172203 r172204 1 2014-08-06 Brian J. Burg <burg@cs.washington.edu> 2 3 Web Inspector: breakpoint resolved state should not depend on all breakpoints being enabled 4 https://bugs.webkit.org/show_bug.cgi?id=135517 5 6 Reviewed by Joseph Pecoraro. 7 8 Previously, Breakpoint.resolved returned false if all breakpoints were disabled, even if 9 the breakpoint had an associated SourceCode. This was a weird hack to make it easier to 10 style breakpoint widgets. This made it hard for other code to deal with resolved 11 breakpoints that were also disabled, or SourceCodeLocations that resolve and unresolve. 12 This patch removes that consideration and fixes style update code to manually check if all 13 breakpoints are being suppressed. 14 15 The code now enforces that a Breakpoint must have a SourceCode before it can be resolved. 16 (As a performance optimization when loading the initial frame tree, we sometimes we give 17 Breakpoints a SourceCode before the debugger officially says that the breakpoint has been 18 resolved. Thus, it's possible to be unresolved with a SourceCode, but not vice-versa.) 19 20 This patch also adds a few guards where we assumed a SourceCodeLocation had a SourceCode. 21 22 * UserInterface/Controllers/DebuggerManager.js: 23 (WebInspector.DebuggerManager.prototype.set breakpointsEnabled): Remove spurious 24 ResolvedStateDidChange events. 25 26 (WebInspector.DebuggerManager.prototype.breakpointResolved): Set the breakpoint's SourceCode 27 if it has not been set already by DebuggerManager.associateBreakpointsWithSourceCode. 28 29 * UserInterface/Models/Breakpoint.js: 30 (WebInspector.Breakpoint.prototype.get resolved): 31 (WebInspector.Breakpoint.prototype.set resolved.isSpecialBreakpoint): 32 (WebInspector.Breakpoint.prototype.set resolved): Add an assertion. 33 * UserInterface/Models/SourceCodeLocation.js: Add guards for !SourceCode. 34 (WebInspector.SourceCodeLocation.prototype.populateLiveDisplayLocationTooltip): 35 * UserInterface/Views/BreakpointTreeElement.js: Account for DebuggerManager.breakpointsEnabled. 36 (WebInspector.BreakpointTreeElement): 37 (WebInspector.BreakpointTreeElement.prototype._updateStatus): 38 * UserInterface/Views/ProbeSetDetailsSection.js: 39 (WebInspector.ProbeSetDetailsSection.prototype._updateLinkElement): Loosen the assertion. 40 * UserInterface/Views/SourceCodeTextEditor.js: Account for DebuggerManager.breakpointsEnabled. 41 (WebInspector.SourceCodeTextEditor): 42 (WebInspector.SourceCodeTextEditor.prototype.close): 43 (WebInspector.SourceCodeTextEditor.prototype._breakpointStatusDidChange): 44 (WebInspector.SourceCodeTextEditor.prototype._breakpointsEnabledDidChange): 45 (WebInspector.SourceCodeTextEditor.prototype._updateBreakpointStatus): 46 * UserInterface/Views/TextEditor.js: Account for DebuggerManager.breakpointsEnabled. 47 1 48 2014-08-06 Brian J. Burg <burg@cs.washington.edu> 2 49 -
trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js
r171784 r172204 109 109 this.dispatchEventToListeners(WebInspector.DebuggerManager.Event.BreakpointsEnabledDidChange); 110 110 111 this._allExceptionsBreakpoint.dispatchEventToListeners(WebInspector.Breakpoint.Event.ResolvedStateDidChange);112 this._allUncaughtExceptionsBreakpoint.dispatchEventToListeners(WebInspector.Breakpoint.Event.ResolvedStateDidChange);113 114 for (var i = 0; i < this._breakpoints.length; ++i)115 this._breakpoints[i].dispatchEventToListeners(WebInspector.Breakpoint.Event.ResolvedStateDidChange);116 117 111 DebuggerAgent.setBreakpointsActive(enabled); 118 112 … … 311 305 312 306 console.assert(breakpoint.identifier === breakpointIdentifier); 307 308 if (!breakpoint.sourceCodeLocation.sourceCode) { 309 var sourceCodeLocation = this._sourceCodeLocationFromPayload(location); 310 breakpoint.sourceCodeLocation.sourceCode = sourceCodeLocation.sourceCode; 311 } 313 312 314 313 breakpoint.resolved = true; -
trunk/Source/WebInspectorUI/UserInterface/Models/Breakpoint.js
r164543 r172204 118 118 get resolved() 119 119 { 120 return this._resolved && WebInspector.debuggerManager.breakpointsEnabled;120 return this._resolved; 121 121 }, 122 122 … … 125 125 if (this._resolved === resolved) 126 126 return; 127 128 function isSpecialBreakpoint() 129 { 130 return this._sourceCodeLocation.isEqual(new WebInspector.SourceCodeLocation(null, Infinity, Infinity)); 131 } 132 133 console.assert(!resolved || this._sourceCodeLocation.sourceCode || isSpecialBreakpoint.call(this), "Breakpoints must have a SourceCode to be resolved.", this); 127 134 128 135 this._resolved = resolved || false; -
trunk/Source/WebInspectorUI/UserInterface/Models/SourceCodeLocation.js
r171790 r172204 227 227 228 228 this.addEventListener(WebInspector.SourceCodeLocation.Event.DisplayLocationChanged, function(event) { 229 element.title = prefix + this.tooltipString(); 229 if (this.sourceCode) 230 element.title = prefix + this.tooltipString(); 230 231 }, this); 231 232 }, … … 259 260 260 261 this.addEventListener(WebInspector.SourceCodeLocation.Event.DisplayLocationChanged, function(event) { 261 updateDisplayString.call(this, currentDisplay, true); 262 if (this.sourceCode) 263 updateDisplayString.call(this, currentDisplay, true); 262 264 }, this); 263 265 -
trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.js
r164543 r172204 41 41 this._listeners.register(breakpoint, WebInspector.Breakpoint.Event.AutoContinueDidChange, this._updateStatus); 42 42 this._listeners.register(breakpoint, WebInspector.Breakpoint.Event.ResolvedStateDidChange, this._updateStatus); 43 this._listeners.register(WebInspector.debuggerManager, WebInspector.DebuggerManager.Event.BreakpointsEnabledDidChange, this._updateStatus); 43 44 44 45 this._listeners.register(WebInspector.probeManager, WebInspector.ProbeManager.Event.ProbeSetAdded, this._probeSetAdded); … … 169 170 this._statusImageElement.classList.remove(WebInspector.BreakpointTreeElement.StatusImageAutoContinueStyleClassName); 170 171 171 if (this._breakpoint.resolved )172 if (this._breakpoint.resolved && WebInspector.debuggerManager.breakpointsEnabled) 172 173 this._statusImageElement.classList.add(WebInspector.BreakpointTreeElement.StatusImageResolvedStyleClassName); 173 174 else -
trunk/Source/WebInspectorUI/UserInterface/Views/ProbeSetDetailsSection.js
r171819 r172204 92 92 var breakpoint = this._probeSet.breakpoint; 93 93 var titleElement = null; 94 if (breakpoint. resolved)94 if (breakpoint.sourceCodeLocation.sourceCode) 95 95 titleElement = WebInspector.createSourceCodeLocationLink(breakpoint.sourceCodeLocation); 96 96 else { 97 97 // Fallback for when we can't create a live source link. 98 console.assert(!breakpoint. sourceCodeLocation.sourceCode);98 console.assert(!breakpoint.resolved); 99 99 100 100 var location = breakpoint.sourceCodeLocation; -
trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js
r171784 r172204 43 43 44 44 if (this._supportsDebugging) { 45 WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.DisabledStateDidChange, this._ updateBreakpointStatus, this);46 WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.AutoContinueDidChange, this._ updateBreakpointStatus, this);47 WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.ResolvedStateDidChange, this._ updateBreakpointStatus, this);45 WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.DisabledStateDidChange, this._breakpointStatusDidChange, this); 46 WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.AutoContinueDidChange, this._breakpointStatusDidChange, this); 47 WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.ResolvedStateDidChange, this._breakpointStatusDidChange, this); 48 48 WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.LocationDidChange, this._updateBreakpointLocation, this); 49 49 50 WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.BreakpointsEnabledDidChange, this._breakpointsEnabledDidChange, this); 50 51 WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.BreakpointAdded, this._breakpointAdded, this); 51 52 WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.BreakpointRemoved, this._breakpointRemoved, this); … … 115 116 { 116 117 if (this._supportsDebugging) { 117 WebInspector.Breakpoint.removeEventListener(WebInspector.Breakpoint.Event.DisabledStateDidChange, this._ updateBreakpointStatus, this);118 WebInspector.Breakpoint.removeEventListener(WebInspector.Breakpoint.Event.AutoContinueDidChange, this._ updateBreakpointStatus, this);119 WebInspector.Breakpoint.removeEventListener(WebInspector.Breakpoint.Event.ResolvedStateDidChange, this._ updateBreakpointStatus, this);118 WebInspector.Breakpoint.removeEventListener(WebInspector.Breakpoint.Event.DisabledStateDidChange, this._breakpointStatusDidChange, this); 119 WebInspector.Breakpoint.removeEventListener(WebInspector.Breakpoint.Event.AutoContinueDidChange, this._breakpointStatusDidChange, this); 120 WebInspector.Breakpoint.removeEventListener(WebInspector.Breakpoint.Event.ResolvedStateDidChange, this._breakpointStatusDidChange, this); 120 121 WebInspector.Breakpoint.removeEventListener(WebInspector.Breakpoint.Event.LocationDidChange, this._updateBreakpointLocation, this); 121 122 123 WebInspector.debuggerManager.removeEventListener(WebInspector.DebuggerManager.Event.BreakpointsEnabledDidChange, this._breakpointsEnabledDidChange, this); 122 124 WebInspector.debuggerManager.removeEventListener(WebInspector.DebuggerManager.Event.BreakpointAdded, this._breakpointAdded, this); 123 125 WebInspector.debuggerManager.removeEventListener(WebInspector.DebuggerManager.Event.BreakpointRemoved, this._breakpointRemoved, this); … … 375 377 }, 376 378 377 _updateBreakpointStatus: function(event) 379 _breakpointStatusDidChange: function(event) 380 { 381 this._updateBreakpointStatus(event.target); 382 }, 383 384 _breakpointsEnabledDidChange: function() 378 385 { 379 386 console.assert(this._supportsDebugging); 380 387 388 var breakpoints = WebInspector.debuggerManager.breakpointsForSourceCode(this._sourceCode); 389 for (var breakpoint of breakpoints) 390 this._updateBreakpointStatus(breakpoint); 391 }, 392 393 _updateBreakpointStatus: function(breakpoint) 394 { 395 console.assert(this._supportsDebugging); 396 381 397 if (!this._contentPopulated) 382 398 return; 383 399 384 var breakpoint = event.target;385 400 if (!this._matchesBreakpoint(breakpoint)) 386 401 return; -
trunk/Source/WebInspectorUI/UserInterface/Views/TextEditor.js
r164846 r172204 933 933 } 934 934 935 allResolved = allResolved && WebInspector.debuggerManager.breakpointsEnabled; 936 935 937 function updateStyles() 936 938 {
Note: See TracChangeset
for help on using the changeset viewer.