Changeset 192560 in webkit
- Timestamp:
- Nov 17, 2015, 5:34:49 PM (10 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r192551 r192560 1 2015-11-17 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Move Timeline creation into a recording 4 https://bugs.webkit.org/show_bug.cgi?id=151367 5 6 Reviewed by Timothy Hatcher. 7 8 * UserInterface/Controllers/TimelineManager.js: 9 (WebInspector.TimelineManager.prototype._loadNewRecording): Deleted. 10 * UserInterface/Models/Timeline.js: 11 (WebInspector.Timeline.create): 12 (WebInspector.Timeline.prototype.get type): 13 (WebInspector.Timeline): Deleted. 14 (WebInspector.Timeline.prototype.get recording): Deleted. 15 * UserInterface/Models/TimelineRecording.js: 16 (WebInspector.TimelineRecording): 17 (WebInspector.TimelineRecording.prototype.get readonly): 18 (WebInspector.TimelineRecording.prototype.unloaded): 19 (WebInspector.TimelineRecording.prototype.reset): 20 (WebInspector.TimelineRecording.prototype.isWritable): Deleted. 21 * UserInterface/Views/TimelineOverview.js: 22 (WebInspector.TimelineOverview): 23 * UserInterface/Views/TimelineRecordingContentView.js: 24 (WebInspector.TimelineRecordingContentView.prototype.shown): 25 1 26 2015-11-17 Matt Baker <mattbaker@apple.com> 2 27 -
trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js
r191967 r192560 448 448 var identifier = this._nextRecordingIdentifier++; 449 449 var newRecording = new WebInspector.TimelineRecording(identifier, WebInspector.UIString("Timeline Recording %d").format(identifier)); 450 newRecording.addTimeline(WebInspector.Timeline.create(WebInspector.TimelineRecord.Type.Network, newRecording));451 newRecording.addTimeline(WebInspector.Timeline.create(WebInspector.TimelineRecord.Type.Layout, newRecording));452 newRecording.addTimeline(WebInspector.Timeline.create(WebInspector.TimelineRecord.Type.Script, newRecording));453 454 // COMPATIBILITY (iOS 8): TimelineAgent.EventType.RenderingFrame did not exist.455 if (window.TimelineAgent && TimelineAgent.EventType.RenderingFrame)456 newRecording.addTimeline(WebInspector.Timeline.create(WebInspector.TimelineRecord.Type.RenderingFrame, newRecording));457 450 458 451 this._recordings.push(newRecording); 459 452 this.dispatchEventToListeners(WebInspector.TimelineManager.Event.RecordingCreated, {recording: newRecording}); 460 461 console.assert(newRecording.isWritable());462 453 463 454 if (this._isCapturing) -
trunk/Source/WebInspectorUI/UserInterface/Models/Timeline.js
r186368 r192560 26 26 WebInspector.Timeline = class Timeline extends WebInspector.Object 27 27 { 28 constructor(type , recording)28 constructor(type) 29 29 { 30 30 super(); 31 31 32 32 this._type = type; 33 this._recording = recording;34 33 35 34 this.reset(true); … … 38 37 // Static 39 38 40 static create(type , recording)39 static create(type) 41 40 { 42 41 if (type === WebInspector.TimelineRecord.Type.Network) 43 return new WebInspector.NetworkTimeline(type , recording);42 return new WebInspector.NetworkTimeline(type); 44 43 45 return new WebInspector.Timeline(type , recording);44 return new WebInspector.Timeline(type); 46 45 } 47 46 48 47 // Public 48 49 get type() 50 { 51 return this._type; 52 } 49 53 50 54 get startTime() … … 61 65 { 62 66 return this._records; 63 }64 65 get type()66 {67 return this._type;68 }69 70 get recording()71 {72 return this._recording;73 67 } 74 68 -
trunk/Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js
r192363 r192560 33 33 this._timelines = new Map; 34 34 this._displayName = displayName; 35 this._isWritable = true; 35 this._readonly = false; 36 37 this.addTimeline(WebInspector.Timeline.create(WebInspector.TimelineRecord.Type.Network)); 38 this.addTimeline(WebInspector.Timeline.create(WebInspector.TimelineRecord.Type.Layout)); 39 this.addTimeline(WebInspector.Timeline.create(WebInspector.TimelineRecord.Type.Script)); 40 41 // COMPATIBILITY (iOS 8): TimelineAgent.EventType.RenderingFrame did not exist. 42 if (window.TimelineAgent && TimelineAgent.EventType.RenderingFrame) 43 this.addTimeline(WebInspector.Timeline.create(WebInspector.TimelineRecord.Type.RenderingFrame)); 36 44 37 45 // For legacy backends, we compute the elapsed time of records relative to this timestamp. … … 58 66 } 59 67 68 get readonly() 69 { 70 return this._readonly; 71 } 72 60 73 get startTime() 61 74 { … … 72 85 // Do nothing. Timeline recordings are not persisted when the inspector is 73 86 // re-opened, so do not attempt to restore by identifier or display name. 74 }75 76 isWritable()77 {78 return this._isWritable;79 87 } 80 88 … … 93 101 console.assert(!this.isEmpty(), "Shouldn't unload an empty recording; it should be reused instead."); 94 102 95 this._ isWritable = false;103 this._readonly = true; 96 104 97 105 this.dispatchEventToListeners(WebInspector.TimelineRecording.Event.Unloaded); … … 100 108 reset(suppressEvents) 101 109 { 102 console.assert( this._isWritable, "Can't reset a read-only recording.");110 console.assert(!this._readonly, "Can't reset a read-only recording."); 103 111 104 112 this._sourceCodeTimelinesMap = new Map; -
trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js
r192198 r192560 30 30 super(); 31 31 32 console.assert(timelineRecording instanceof WebInspector.TimelineRecording); 33 32 34 this._recording = timelineRecording; 33 35 this._recording.addEventListener(WebInspector.TimelineRecording.Event.TimelineAdded, this._timelineAdded, this); -
trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js
r192086 r192560 165 165 this._currentTimelineOverview.shown(); 166 166 this._contentViewContainer.shown(); 167 this._clearTimelineNavigationItem.enabled = this._recording.isWritable();167 this._clearTimelineNavigationItem.enabled = !this._recording.readonly; 168 168 169 169 this._currentContentViewDidChange();
Note:
See TracChangeset
for help on using the changeset viewer.