Changeset 198774 in webkit
- Timestamp:
- Mar 28, 2016, 8:28:10 PM (10 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 6 edited
-
ChangeLog (modified) (1 diff)
-
Localizations/en.lproj/localizedStrings.js (modified) (2 diffs)
-
UserInterface/Controllers/DebuggerManager.js (modified) (6 diffs)
-
UserInterface/Controllers/TimelineManager.js (modified) (2 diffs)
-
UserInterface/Views/DebuggerSidebarPanel.css (modified) (3 diffs)
-
UserInterface/Views/DebuggerSidebarPanel.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r198751 r198774 1 2016-03-28 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Ensure maximum accuracy while profiling 4 https://bugs.webkit.org/show_bug.cgi?id=155809 5 <rdar://problem/25325035> 6 7 Reviewed by Timothy Hatcher. 8 9 * Localizations/en.lproj/localizedStrings.js: 10 New strings. 11 12 * UserInterface/Controllers/DebuggerManager.js: 13 (WebInspector.DebuggerManager): 14 When starting the inspector, if it was previously closed while 15 breakpoints were temporarily disabled, restore the correct 16 breakpoints enabled state. 17 18 (WebInspector.DebuggerManager.prototype.set breakpointsEnabled): 19 Warn if we ever try to enable breakpoints during timeline recordings. 20 21 (WebInspector.DebuggerManager.prototype.get breakpointsDisabledTemporarily): 22 (WebInspector.DebuggerManager.prototype.startDisablingBreakpointsTemporarily): 23 (WebInspector.DebuggerManager.prototype.stopDisablingBreakpointsTemporarily): 24 Method to start/stop temporarily disabling breakpoints. 25 26 (WebInspector.DebuggerManager.prototype._breakpointDisabledStateDidChange): 27 (WebInspector.DebuggerManager.prototype._setBreakpoint): 28 When temporarily disabling breakpoints avoid the convenience behavior of 29 enabling all breakpoints when enabling or setting a single breakpoint. 30 31 * UserInterface/Controllers/TimelineManager.js: 32 (WebInspector.TimelineManager.prototype.startCapturing): 33 Emit a will start capturing event to do work before enabling instruments. 34 35 * UserInterface/Views/DebuggerSidebarPanel.css: 36 (.sidebar > .panel.navigation.debugger .timeline-recording-warning): 37 (.sidebar > .panel.navigation.debugger .timeline-recording-warning > a): 38 Styles for a warning section in the Debugger Sidebar when the Debugger 39 is temporarily disabled due to a Timeline recording. 40 41 * UserInterface/Views/DebuggerSidebarPanel.js: 42 (WebInspector.DebuggerSidebarPanel.prototype._timelineRecordingWillStart): 43 (WebInspector.DebuggerSidebarPanel.prototype._timelineRecordingStopped): 44 Modify the Debugger state and UI before and after a Timeline recording. 45 1 46 2016-03-28 Nikita Vasilyev <nvasilyev@apple.com> 2 47 -
trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
r198537 r198774 216 216 localizedStrings["Debugger Paused"] = "Debugger Paused"; 217 217 localizedStrings["Debugger Statement"] = "Debugger Statement"; 218 localizedStrings["Debugger is disabled during a Timeline recording."] = "Debugger is disabled during a Timeline recording."; 218 219 localizedStrings["Decoded"] = "Decoded"; 219 220 localizedStrings["Decoration"] = "Decoration"; … … 684 685 localizedStrings["Stop Recording"] = "Stop Recording"; 685 686 localizedStrings["Stop recording (%s)"] = "Stop recording (%s)"; 687 localizedStrings["Stop recording."] = "Stop recording."; 686 688 localizedStrings["Storage"] = "Storage"; 687 689 localizedStrings["Style"] = "Style"; -
trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js
r198555 r198774 72 72 this._breakpointsEnabledSetting = new WebInspector.Setting("breakpoints-enabled", true); 73 73 74 // Restore the correct breakpoints enabled setting if Web Inspector had 75 // previously been left in a state where breakpoints were temporarily disabled. 76 this._temporarilyDisabledBreakpointsRestoreSetting = new WebInspector.Setting("temporarily-disabled-breakpoints-restore", null); 77 if (this._temporarilyDisabledBreakpointsRestoreSetting.value !== null) { 78 this._breakpointsEnabledSetting.value = this._temporarilyDisabledBreakpointsRestoreSetting.value; 79 this._temporarilyDisabledBreakpointsRestoreSetting.value = null; 80 } 81 74 82 if (window.DebuggerAgent) 75 83 DebuggerAgent.setBreakpointsActive(this._breakpointsEnabledSetting.value); … … 99 107 { 100 108 if (this._breakpointsEnabledSetting.value === enabled) 109 return; 110 111 console.assert(!(enabled && this.breakpointsDisabledTemporarily), "Should not enable breakpoints when we are temporarily disabling breakpoints."); 112 if (enabled && this.breakpointsDisabledTemporarily) 101 113 return; 102 114 … … 334 346 335 347 return knownScripts; 348 } 349 350 get breakpointsDisabledTemporarily() 351 { 352 return this._temporarilyDisabledBreakpointsRestoreSetting.value !== null; 353 } 354 355 startDisablingBreakpointsTemporarily() 356 { 357 console.assert(this._temporarilyDisabledBreakpointsRestoreSetting.value === null, "Already temporarily disabling breakpoints."); 358 if (this._temporarilyDisabledBreakpointsRestoreSetting.value !== null) 359 return; 360 361 this._temporarilyDisabledBreakpointsRestoreSetting.value = this._breakpointsEnabledSetting.value; 362 363 this.breakpointsEnabled = false; 364 } 365 366 stopDisablingBreakpointsTemporarily() 367 { 368 console.assert(this._temporarilyDisabledBreakpointsRestoreSetting.value !== null, "Was not temporarily disabling breakpoints."); 369 if (this._temporarilyDisabledBreakpointsRestoreSetting.value === null) 370 return; 371 372 let restoreState = this._temporarilyDisabledBreakpointsRestoreSetting.value; 373 this._temporarilyDisabledBreakpointsRestoreSetting.value = null; 374 375 this.breakpointsEnabled = restoreState; 336 376 } 337 377 … … 688 728 return; 689 729 690 if (!this._restoringBreakpoints ) {730 if (!this._restoringBreakpoints && !this.breakpointsDisabledTemporarily) { 691 731 // Enable breakpoints since a breakpoint is being set. This eliminates 692 732 // a multi-step process for the user that can be confusing. … … 801 841 let breakpoint = event.target; 802 842 if (breakpoint === this._allExceptionsBreakpoint) { 803 if (!breakpoint.disabled )843 if (!breakpoint.disabled && !this.breakpointsDisabledTemporarily) 804 844 this.breakpointsEnabled = true; 805 845 this._allExceptionsBreakpointEnabledSetting.value = !breakpoint.disabled; … … 809 849 810 850 if (breakpoint === this._allUncaughtExceptionsBreakpoint) { 811 if (!breakpoint.disabled )851 if (!breakpoint.disabled && !this.breakpointsDisabledTemporarily) 812 852 this.breakpointsEnabled = true; 813 853 this._allUncaughtExceptionsBreakpointEnabledSetting.value = !breakpoint.disabled; -
trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js
r198537 r198774 159 159 this._loadNewRecording(); 160 160 161 this.dispatchEventToListeners(WebInspector.TimelineManager.Event.CapturingWillStart); 162 161 163 this._activeRecording.start(); 162 164 } … … 867 869 RecordingCreated: "timeline-manager-recording-created", 868 870 RecordingLoaded: "timeline-manager-recording-loaded", 871 CapturingWillStart: "timeline-manager-capturing-will-start", 869 872 CapturingStarted: "timeline-manager-capturing-started", 870 873 CapturingStopped: "timeline-manager-capturing-stopped" -
trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.css
r196713 r198774 24 24 */ 25 25 26 27 26 .sidebar > .panel.navigation.debugger > :matches(.content, .empty-content-placeholder) { 28 27 top: 29px; … … 34 33 left: 0; 35 34 right: 0; 35 } 36 37 .sidebar > .panel.navigation.debugger .timeline-recording-warning { 38 text-align: center; 39 font-size: 11px; 40 41 padding: 11px 6px; 42 margin-bottom: 6px; 43 44 border-bottom: 1px solid var(--border-color); 45 background-color: hsl(50, 100%, 94%); 46 } 47 48 .sidebar > .panel.navigation.debugger .timeline-recording-warning > a { 49 text-decoration: underline; 50 cursor: pointer; 36 51 } 37 52 … … 47 62 display: none; 48 63 } 49 50 64 51 65 .sidebar > .panel.navigation.debugger .details-section > .content > .group { -
trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js
r194879 r198774 47 47 WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.WaitingToPause, this._debuggerWaitingToPause, this); 48 48 49 WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.CapturingWillStart, this._timelineRecordingWillStart, this); 50 WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.CapturingStopped, this._timelineRecordingStopped, this); 51 52 this._timelineRecordingWarningElement = document.createElement("div"); 53 this._timelineRecordingWarningElement.classList.add("timeline-recording-warning"); 54 this._timelineRecordingWarningElement.append(WebInspector.UIString("Debugger is disabled during a Timeline recording."), " "); 55 let stopRecordingLink = this._timelineRecordingWarningElement.appendChild(document.createElement("a")); 56 stopRecordingLink.textContent = WebInspector.UIString("Stop recording."); 57 stopRecordingLink.addEventListener("click", () => { WebInspector.timelineManager.stopCapturing(); }); 58 49 59 this._navigationBar = new WebInspector.NavigationBar; 50 60 this.addSubview(this._navigationBar); … … 386 396 this._addBreakpointsForSourceCode(resource); 387 397 this._addIssuesForSourceCode(resource); 398 } 399 400 _timelineRecordingWillStart(event) 401 { 402 WebInspector.debuggerManager.startDisablingBreakpointsTemporarily(); 403 404 if (WebInspector.debuggerManager.paused) 405 WebInspector.debuggerManager.resume(); 406 407 this._debuggerBreakpointsButtonItem.enabled = false; 408 this._debuggerPauseResumeButtonItem.enabled = false; 409 410 this.contentView.element.insertBefore(this._timelineRecordingWarningElement, this.contentView.element.firstChild); 411 } 412 413 _timelineRecordingStopped(event) 414 { 415 WebInspector.debuggerManager.stopDisablingBreakpointsTemporarily(); 416 417 this._debuggerBreakpointsButtonItem.enabled = true; 418 this._debuggerPauseResumeButtonItem.enabled = true; 419 420 this._timelineRecordingWarningElement.remove(); 388 421 } 389 422
Note:
See TracChangeset
for help on using the changeset viewer.