Bug 1359951 - Ensure that the WebSocket not sending constructor when shutting down. r=nwgh, a=gchang
authorJunior Hsu <juhsu@mozilla.com>
Tue, 02 May 2017 19:50:00 +0200
changeset 396225 40c0c72fd4ef79fa8fa7acea3f53e2925124156d
parent 396224 ecca51aa18de76d4475b4bf9faf5f845e22c7891
child 396226 6d27074d2779a928f29407042dc553cccfd43118
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnwgh, gchang
bugs1359951
milestone54.0
Bug 1359951 - Ensure that the WebSocket not sending constructor when shutting down. r=nwgh, a=gchang
netwerk/protocol/websocket/WebSocketChannelChild.cpp
--- a/netwerk/protocol/websocket/WebSocketChannelChild.cpp
+++ b/netwerk/protocol/websocket/WebSocketChannelChild.cpp
@@ -479,16 +479,21 @@ WebSocketChannelChild::AsyncOpen(nsIURI 
                                 getter_AddRefs(iTabChild));
   if (iTabChild) {
     tabChild = static_cast<mozilla::dom::TabChild*>(iTabChild.get());
   }
   if (MissingRequiredTabChild(tabChild, "websocket")) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
 
+  ContentChild* cc = static_cast<ContentChild*>(gNeckoChild->Manager());
+  if (cc->IsShuttingDown()) {
+    return NS_ERROR_FAILURE;
+  }
+
   // Corresponding release in DeallocPWebSocket
   AddIPDLReference();
 
   OptionalURIParams uri;
   OptionalLoadInfoArgs loadInfoArgs;
   OptionalTransportProvider transportProvider;
 
   if (!mIsServerSide) {