Title: [241039] trunk/Source/WebInspectorUI
Revision
241039
Author
[email protected]
Date
2019-02-06 11:57:38 -0800 (Wed, 06 Feb 2019)

Log Message

Web Inspector: "Worker not found" uncaught protocol errors
https://bugs.webkit.org/show_bug.cgi?id=194319

Patch by Joseph Pecoraro <[email protected]> on 2019-02-06
Reviewed by Matt Baker.

* UserInterface/Base/Main.js:
(WI.terminatePageTarget):
Remove Worker targets associated with the Page on navigation.
Eventually we will have to associate Workers with their parent
frame, but for now a transition can only happen at the Page
level, so we can eliminate all workers on the page.

* UserInterface/Controllers/WorkerManager.js:
(WI.WorkerManager.prototype.workerCreated):
* UserInterface/Protocol/Connection.js:
(InspectorBackend.WorkerConnection.sendMessageToBackend):
Allow any WorkerAgent domain message to fail silently. This can
happen if a Worker is created and destroyed before the frontend
hears about it and sends messages to the backend for that Worker.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (241038 => 241039)


--- trunk/Source/WebInspectorUI/ChangeLog	2019-02-06 19:50:12 UTC (rev 241038)
+++ trunk/Source/WebInspectorUI/ChangeLog	2019-02-06 19:57:38 UTC (rev 241039)
@@ -1,3 +1,25 @@
+2019-02-06  Joseph Pecoraro  <[email protected]>
+
+        Web Inspector: "Worker not found" uncaught protocol errors
+        https://bugs.webkit.org/show_bug.cgi?id=194319
+
+        Reviewed by Matt Baker.
+
+        * UserInterface/Base/Main.js:
+        (WI.terminatePageTarget):
+        Remove Worker targets associated with the Page on navigation.
+        Eventually we will have to associate Workers with their parent
+        frame, but for now a transition can only happen at the Page
+        level, so we can eliminate all workers on the page.
+
+        * UserInterface/Controllers/WorkerManager.js:
+        (WI.WorkerManager.prototype.workerCreated):
+        * UserInterface/Protocol/Connection.js:
+        (InspectorBackend.WorkerConnection.sendMessageToBackend):
+        Allow any WorkerAgent domain message to fail silently. This can
+        happen if a Worker is created and destroyed before the frontend
+        hears about it and sends messages to the backend for that Worker.
+
 2019-02-05  Nikita Vasilyev  <[email protected]>
 
         Web Inspector: Styles: PropertiesChanged shouldn't fire when old and new text are both empty

Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Main.js (241038 => 241039)


--- trunk/Source/WebInspectorUI/UserInterface/Base/Main.js	2019-02-06 19:50:12 UTC (rev 241038)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Main.js	2019-02-06 19:57:38 UTC (rev 241039)
@@ -228,6 +228,11 @@
     console.assert(WI.pageTarget === target);
     console.assert(WI.sharedApp.debuggableType === WI.DebuggableType.Web);
 
+    // Remove any Worker targets associated with this page.
+    let workerTargets = WI.targets.filter((x) => x.type === WI.Target.Type.Worker);
+    for (let workerTarget of workerTargets)
+        WI.workerManager.workerTerminated(workerTarget.identifier);
+
     WI.pageTarget = null;
 
     WI.redirectGlobalAgentsToConnection(WI.backendConnection);

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/WorkerManager.js (241038 => 241039)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/WorkerManager.js	2019-02-06 19:50:12 UTC (rev 241038)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/WorkerManager.js	2019-02-06 19:57:38 UTC (rev 241039)
@@ -55,7 +55,8 @@
         this._connections.set(workerId, connection);
 
         // Unpause the worker now that we have sent all initialization messages.
-        WorkerAgent.initialized(workerId);
+        // Ignore errors if a worker went away quickly.
+        WorkerAgent.initialized(workerId).catch(function(){});
     }
 
     workerTerminated(workerId)

Modified: trunk/Source/WebInspectorUI/UserInterface/Protocol/Connection.js (241038 => 241039)


--- trunk/Source/WebInspectorUI/UserInterface/Protocol/Connection.js	2019-02-06 19:50:12 UTC (rev 241038)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/Connection.js	2019-02-06 19:57:38 UTC (rev 241039)
@@ -308,7 +308,8 @@
 
     sendMessageToBackend(message)
     {
-        WorkerAgent.sendMessageToWorker(this._workerId, message);
+        // Ignore errors if a worker went away quickly.
+        WorkerAgent.sendMessageToWorker(this._workerId, message).catch(function(){});
     }
 };
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to