Web Inspector: Uncaught Exception: Content request failed.
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Aug 2019 17:15:15 +0000 (17:15 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Aug 2019 17:15:15 +0000 (17:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=200704
<rdar://problem/54279372>

Reviewed by Brian Burg.

* UserInterface/Models/WebSocketResource.js:
(WI.WebSocketResource.prototype.requestContentFromBackend): Added.
Add an "assert not reached", as WebSocket resources don't really have "content", instead
having a list of send/receive frames.

* UserInterface/Views/ResourceClusterContentView.js:
(WI.ResourceClusterContentView.prototype._tryEnableCustomResponseContentView):
Don't attempt to request the content of any `WI.WebSocketResource` for the reason above.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248720 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Models/WebSocketResource.js
Source/WebInspectorUI/UserInterface/Views/ResourceClusterContentView.js

index 4616b03..cd113b4 100644 (file)
@@ -1,3 +1,20 @@
+2019-08-15  Devin Rousso  <drousso@apple.com>
+
+        Web Inspector: Uncaught Exception: Content request failed.
+        https://bugs.webkit.org/show_bug.cgi?id=200704
+        <rdar://problem/54279372>
+
+        Reviewed by Brian Burg.
+
+        * UserInterface/Models/WebSocketResource.js:
+        (WI.WebSocketResource.prototype.requestContentFromBackend): Added.
+        Add an "assert not reached", as WebSocket resources don't really have "content", instead
+        having a list of send/receive frames.
+
+        * UserInterface/Views/ResourceClusterContentView.js:
+        (WI.ResourceClusterContentView.prototype._tryEnableCustomResponseContentView):
+        Don't attempt to request the content of any `WI.WebSocketResource` for the reason above.
+
 2019-08-14  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: Elements: Computed: move the Box Model section to the top
index d7caf9e..1ebfd09 100644 (file)
@@ -85,6 +85,15 @@ WI.WebSocketResource = class WebSocketResource extends WI.Resource
         this.dispatchEventToListeners(WI.WebSocketResource.Event.FrameAdded, frame);
     }
 
+    // Protected
+
+    requestContentFromBackend()
+    {
+        console.assert(false, "A WebSocket's content was requested. WebSockets do not have content so the request is nonsensical.");
+
+        return super.requestContentFromBackend();
+    }
+
     // Private
 
     _walltimeForWebSocketTimestamp(timestamp)
index 5582e03..282b945 100644 (file)
@@ -364,6 +364,10 @@ WI.ResourceClusterContentView = class ResourceClusterContentView extends WI.Clus
         if (!this._resource.hasResponse())
             return;
 
+        // WebSocket resources already use a "custom" response content view.
+        if (this._resource instanceof WI.WebSocketResource)
+            return;
+
         this._resource.requestContent()
         .then(({error, content}) => {
             if (error || !content || !this._canUseJSONContentViewForContent(content))