mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-04 11:26:09 +00:00
Bug 1211001 - constant ASSERTION: nsITimer->SetDelay() called when the one-shot timer is not set up, r=mcmanus
This commit is contained in:
parent
d12bfed3c9
commit
05dff5829e
@ -3072,16 +3072,14 @@ WebSocketChannel::Notify(nsITimer *timer)
|
||||
}
|
||||
|
||||
if (!mPingOutstanding) {
|
||||
// Allow for the case where a PING was force-sent even though ping
|
||||
// interval isn't enabled. Only issue a new PING if it truly is enabled.
|
||||
if (mPingInterval || mPingForced) {
|
||||
LOG(("nsWebSocketChannel:: Generating Ping\n"));
|
||||
mPingOutstanding = 1;
|
||||
mPingForced = 0;
|
||||
GeneratePing();
|
||||
mPingTimer->InitWithCallback(this, mPingResponseTimeout,
|
||||
nsITimer::TYPE_ONE_SHOT);
|
||||
}
|
||||
// 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);
|
||||
} else {
|
||||
LOG(("nsWebSocketChannel:: Timed out Ping\n"));
|
||||
mPingTimer = nullptr;
|
||||
|
@ -178,7 +178,14 @@ private:
|
||||
{
|
||||
mPingOutstanding = 0;
|
||||
if (mPingTimer) {
|
||||
mPingTimer->SetDelay(mPingInterval);
|
||||
if (!mPingInterval) {
|
||||
// The timer was created by forced ping and regular pinging is disabled,
|
||||
// so cancel and null out mPingTimer.
|
||||
mPingTimer->Cancel();
|
||||
mPingTimer = nullptr;
|
||||
} else {
|
||||
mPingTimer->SetDelay(mPingInterval);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user