Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1640)

Unified Diff: Source/modules/websockets/WebSocket.cpp

Issue 16385005: Avoid WebSocket::stop() being processed twice (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/websockets/WebSocket.cpp
diff --git a/Source/modules/websockets/WebSocket.cpp b/Source/modules/websockets/WebSocket.cpp
index d9521189d1f1cc283f7ed38d28e4e125ee4bd939..f91ecaad6ac33ddc73c23d5db3b5f6ca6f8cd0ca 100644
--- a/Source/modules/websockets/WebSocket.cpp
+++ b/Source/modules/websockets/WebSocket.cpp
@@ -489,14 +489,18 @@ void WebSocket::resume()
void WebSocket::stop()
{
- bool pending = hasPendingActivity();
- if (m_channel)
+ if (!hasPendingActivity()) {
+ ASSERT(!m_channel);
+ ASSERT(m_state == CLOSED);
+ return;
+ }
+ if (m_channel) {
m_channel->disconnect();
- m_channel = 0;
+ m_channel = 0;
+ }
m_state = CLOSED;
ActiveDOMObject::stop();
- if (pending)
- ActiveDOMObject::unsetPendingActivity(this);
+ ActiveDOMObject::unsetPendingActivity(this);
}
void WebSocket::didConnect()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698