Changeset 238750 in webkit


Ignore:
Timestamp:
Nov 30, 2018 1:13:27 PM (5 years ago)
Author:
Joseph Pecoraro
Message:

Web Inspector: Uncaught Exception opening Web Inspector to Debugger Tab
https://bugs.webkit.org/show_bug.cgi?id=192174

Reviewed by Devin Rousso.

  • UserInterface/Protocol/InspectorBackend.js:

(InspectorBackendClass.prototype.runAfterPendingDispatches):
Dispatch the callback with a timeout if there is no backend target yet
so it doesn't get lost.

  • UserInterface/Protocol/Connection.js:

(InspectorBackend.Connection.prototype.runAfterPendingDispatches):
Change the ambiguous name "script" to the more familiar "callback".

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r238743 r238750  
     12018-11-30  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Uncaught Exception opening Web Inspector to Debugger Tab
     4        https://bugs.webkit.org/show_bug.cgi?id=192174
     5
     6        Reviewed by Devin Rousso.
     7
     8        * UserInterface/Protocol/InspectorBackend.js:
     9        (InspectorBackendClass.prototype.runAfterPendingDispatches):
     10        Dispatch the callback with a timeout if there is no backend target yet
     11        so it doesn't get lost.
     12
     13        * UserInterface/Protocol/Connection.js:
     14        (InspectorBackend.Connection.prototype.runAfterPendingDispatches):
     15        Change the ambiguous name "script" to the more familiar "callback".
     16
    1172018-11-30  Devin Rousso  <drousso@apple.com>
    218
  • trunk/Source/WebInspectorUI/UserInterface/Protocol/Connection.js

    r238330 r238750  
    3939        this._pendingResponses = new Map;
    4040        this._agents = {};
    41         this._deferredScripts = [];
     41        this._deferredCallbacks = [];
    4242        this._target = null;
    4343    }
     
    7373    }
    7474
    75     runAfterPendingDispatches(script)
    76     {
    77         console.assert(typeof script === "function");
     75    runAfterPendingDispatches(callback)
     76    {
     77        console.assert(typeof callback === "function");
    7878
    7979        if (!this._pendingResponses.size)
    80             script.call(this);
     80            callback.call(this);
    8181        else
    82             this._deferredScripts.push(script);
     82            this._deferredCallbacks.push(callback);
    8383    }
    8484
     
    131131            tracer.logDidHandleResponse(this, messageObject, {rtt: roundTripTime, dispatch: processingTime});
    132132
    133         if (this._deferredScripts.length && !this._pendingResponses.size)
     133        if (this._deferredCallbacks.length && !this._pendingResponses.size)
    134134            this._flushPendingScripts();
    135135    }
     
    268268        console.assert(this._pendingResponses.size === 0);
    269269
    270         let scriptsToRun = this._deferredScripts;
    271         this._deferredScripts = [];
     270        let scriptsToRun = this._deferredCallbacks;
     271        this._deferredCallbacks = [];
    272272        for (let script of scriptsToRun)
    273273            script.call(this);
  • trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js

    r238331 r238750  
    173173    }
    174174
    175     runAfterPendingDispatches(script)
    176     {
     175    runAfterPendingDispatches(callback)
     176    {
     177        if (!WI.mainTarget) {
     178            callback();
     179            return;
     180        }
     181
    177182        // FIXME: Should this respect pending dispatches in all connections?
    178         WI.mainTarget.connection.runAfterPendingDispatches(script);
     183        WI.mainTarget.connection.runAfterPendingDispatches(callback);
    179184    }
    180185
Note: See TracChangeset for help on using the changeset viewer.