Bug 1271527 - Crash in mozilla::net::WebSocketChannel::Notify, r=mcmanus a=ritu
authorMichal Novotny <michal.novotny@gmail.com>
Thu, 12 May 2016 13:28:50 +0200
changeset 332879 29b70219b2c72a44cb58f8410900c7d11b1af73c
parent 332878 9b83310bcad8d5cb3090f6c6338c95864f6b2fe2
child 332880 b27e0175db555f813fc6dfb044580b9b90c394c4
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus, ritu
bugs1271527
milestone48.0a2
Bug 1271527 - Crash in mozilla::net::WebSocketChannel::Notify, r=mcmanus a=ritu
netwerk/protocol/websocket/WebSocketChannel.cpp
--- a/netwerk/protocol/websocket/WebSocketChannel.cpp
+++ b/netwerk/protocol/websocket/WebSocketChannel.cpp
@@ -3127,19 +3127,19 @@ WebSocketChannel::Notify(nsITimer *timer
     }
 
     if (!mPingOutstanding) {
       // Ping interval must be non-null or PING was forced by OnNetworkChanged()
       MOZ_ASSERT(mPingInterval || mPingForced);
       LOG(("nsWebSocketChannel:: Generating Ping\n"));
       mPingOutstanding = 1;
       mPingForced = 0;
-      GeneratePing();
       mPingTimer->InitWithCallback(this, mPingResponseTimeout,
                                    nsITimer::TYPE_ONE_SHOT);
+      GeneratePing();
     } else {
       LOG(("nsWebSocketChannel:: Timed out Ping\n"));
       mPingTimer = nullptr;
       AbortSession(NS_ERROR_NET_TIMEOUT);
     }
   } else if (timer == mLingeringCloseTimer) {
     LOG(("WebSocketChannel:: Lingering Close Timer"));
     CleanupConnection();