Changeset 238864 in webkit


Ignore:
Timestamp:
Dec 4, 2018 11:07:57 AM (5 years ago)
Author:
Joseph Pecoraro
Message:

Web Inspector: REGRESSION(r238330): Timeline auto-capture does not work after page transition
https://bugs.webkit.org/show_bug.cgi?id=192248
<rdar://problem/46390199>

Reviewed by Devin Rousso.

  • UserInterface/Base/Main.js:

(WI.transitionPageTarget):
Let the TimelineManager perform work on page transitions.

  • UserInterface/Controllers/TimelineManager.js:

(WI.TimelineManager.prototype.initializeTarget):
Initialize the autocapture state of the target.

(WI.TimelineManager.prototype.transitionPageTarget):
When transitioning pages perform a legacy (frontend based) timeline capture.

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r238859 r238864  
     12018-12-04  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: REGRESSION(r238330): Timeline auto-capture does not work after page transition
     4        https://bugs.webkit.org/show_bug.cgi?id=192248
     5        <rdar://problem/46390199>
     6
     7        Reviewed by Devin Rousso.
     8
     9        * UserInterface/Base/Main.js:
     10        (WI.transitionPageTarget):
     11        Let the TimelineManager perform work on page transitions.
     12
     13        * UserInterface/Controllers/TimelineManager.js:
     14        (WI.TimelineManager.prototype.initializeTarget):
     15        Initialize the autocapture state of the target.
     16
     17        (WI.TimelineManager.prototype.transitionPageTarget):
     18        When transitioning pages perform a legacy (frontend based) timeline capture.
     19
    1202018-12-04  Matt Baker  <mattbaker@apple.com>
    221
  • trunk/Source/WebInspectorUI/UserInterface/Base/Main.js

    r238660 r238864  
    215215    WI.domManager.transitionPageTarget();
    216216    WI.networkManager.transitionPageTarget();
     217    WI.timelineManager.transitionPageTarget();
    217218};
    218219
  • trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js

    r238484 r238864  
    5050        this._mainResourceForAutoCapturing = null;
    5151        this._shouldSetAutoCapturingMainResource = false;
     52        this._transitioningPageTarget = false;
    5253        this._boundStopCapturing = this.stopCapturing.bind(this);
    5354
     
    6667    initializeTarget(target)
    6768    {
    68         this._updateAutoCaptureInstruments([target]);
     69        if (target.TimelineAgent) {
     70            this._updateAutoCaptureInstruments([target]);
     71
     72            // COMPATIBILITY (iOS 9): Timeline.setAutoCaptureEnabled did not exist.
     73            if (target.TimelineAgent.setAutoCaptureEnabled)
     74                target.TimelineAgent.setAutoCaptureEnabled(this._autoCaptureOnPageLoad);
     75        }
     76    }
     77
     78    transitionPageTarget()
     79    {
     80        this._transitioningPageTarget = true;
    6981    }
    7082
     
    831843
    832844        let frame = event.target;
     845
     846        // When performing a page transition start a recording once the main resource changes.
     847        // We start a legacy capture because the backend wasn't available to automatically
     848        // initiate the capture, so the frontend must start the capture.
     849        if (this._transitioningPageTarget) {
     850            this._transitioningPageTarget = false;
     851            if (this._autoCaptureOnPageLoad)
     852                this._legacyAttemptStartAutoCapturingForFrame(frame);
     853            return;
     854        }
     855
    833856        if (this._attemptAutoCapturingForFrame(frame))
    834857            return;
Note: See TracChangeset for help on using the changeset viewer.