Changeset 192560 in webkit


Ignore:
Timestamp:
Nov 17, 2015, 5:34:49 PM (10 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: Move Timeline creation into a recording
https://bugs.webkit.org/show_bug.cgi?id=151367

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2015-11-17
Reviewed by Timothy Hatcher.

  • UserInterface/Controllers/TimelineManager.js:

(WebInspector.TimelineManager.prototype._loadNewRecording): Deleted.

  • UserInterface/Models/Timeline.js:

(WebInspector.Timeline.create):
(WebInspector.Timeline.prototype.get type):
(WebInspector.Timeline): Deleted.
(WebInspector.Timeline.prototype.get recording): Deleted.

  • UserInterface/Models/TimelineRecording.js:

(WebInspector.TimelineRecording):
(WebInspector.TimelineRecording.prototype.get readonly):
(WebInspector.TimelineRecording.prototype.unloaded):
(WebInspector.TimelineRecording.prototype.reset):
(WebInspector.TimelineRecording.prototype.isWritable): Deleted.

  • UserInterface/Views/TimelineOverview.js:

(WebInspector.TimelineOverview):

  • UserInterface/Views/TimelineRecordingContentView.js:

(WebInspector.TimelineRecordingContentView.prototype.shown):

Location:
trunk/Source/WebInspectorUI
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r192551 r192560  
     12015-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
    1262015-11-17  Matt Baker  <mattbaker@apple.com>
    227
  • trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js

    r191967 r192560  
    448448        var identifier = this._nextRecordingIdentifier++;
    449449        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));
    457450
    458451        this._recordings.push(newRecording);
    459452        this.dispatchEventToListeners(WebInspector.TimelineManager.Event.RecordingCreated, {recording: newRecording});
    460 
    461         console.assert(newRecording.isWritable());
    462453
    463454        if (this._isCapturing)
  • trunk/Source/WebInspectorUI/UserInterface/Models/Timeline.js

    r186368 r192560  
    2626WebInspector.Timeline = class Timeline extends WebInspector.Object
    2727{
    28     constructor(type, recording)
     28    constructor(type)
    2929    {
    3030        super();
    3131
    3232        this._type = type;
    33         this._recording = recording;
    3433
    3534        this.reset(true);
     
    3837    // Static
    3938
    40     static create(type, recording)
     39    static create(type)
    4140    {
    4241        if (type === WebInspector.TimelineRecord.Type.Network)
    43             return new WebInspector.NetworkTimeline(type, recording);
     42            return new WebInspector.NetworkTimeline(type);
    4443
    45         return new WebInspector.Timeline(type, recording);
     44        return new WebInspector.Timeline(type);
    4645    }
    4746
    4847    // Public
     48
     49    get type()
     50    {
     51        return this._type;
     52    }
    4953
    5054    get startTime()
     
    6165    {
    6266        return this._records;
    63     }
    64 
    65     get type()
    66     {
    67         return this._type;
    68     }
    69 
    70     get recording()
    71     {
    72         return this._recording;
    7367    }
    7468
  • trunk/Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js

    r192363 r192560  
    3333        this._timelines = new Map;
    3434        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));
    3644
    3745        // For legacy backends, we compute the elapsed time of records relative to this timestamp.
     
    5866    }
    5967
     68    get readonly()
     69    {
     70        return this._readonly;
     71    }
     72
    6073    get startTime()
    6174    {
     
    7285        // Do nothing. Timeline recordings are not persisted when the inspector is
    7386        // re-opened, so do not attempt to restore by identifier or display name.
    74     }
    75 
    76     isWritable()
    77     {
    78         return this._isWritable;
    7987    }
    8088
     
    93101        console.assert(!this.isEmpty(), "Shouldn't unload an empty recording; it should be reused instead.");
    94102
    95         this._isWritable = false;
     103        this._readonly = true;
    96104
    97105        this.dispatchEventToListeners(WebInspector.TimelineRecording.Event.Unloaded);
     
    100108    reset(suppressEvents)
    101109    {
    102         console.assert(this._isWritable, "Can't reset a read-only recording.");
     110        console.assert(!this._readonly, "Can't reset a read-only recording.");
    103111
    104112        this._sourceCodeTimelinesMap = new Map;
  • trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js

    r192198 r192560  
    3030        super();
    3131
     32        console.assert(timelineRecording instanceof WebInspector.TimelineRecording);
     33
    3234        this._recording = timelineRecording;
    3335        this._recording.addEventListener(WebInspector.TimelineRecording.Event.TimelineAdded, this._timelineAdded, this);
  • trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js

    r192086 r192560  
    165165        this._currentTimelineOverview.shown();
    166166        this._contentViewContainer.shown();
    167         this._clearTimelineNavigationItem.enabled = this._recording.isWritable();
     167        this._clearTimelineNavigationItem.enabled = !this._recording.readonly;
    168168
    169169        this._currentContentViewDidChange();
Note: See TracChangeset for help on using the changeset viewer.