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

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

Issue 27571005: Replace Timers used in ActiveDOMObject with AsyncMethodRunner (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 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
Index: Source/modules/websockets/WebSocket.cpp
diff --git a/Source/modules/websockets/WebSocket.cpp b/Source/modules/websockets/WebSocket.cpp
index 3868acfda51786aa6abfc36ff912a3b16115476c..f685f1b9c9c8c85b8c8222c3525ef6079d6c9e39 100644
--- a/Source/modules/websockets/WebSocket.cpp
+++ b/Source/modules/websockets/WebSocket.cpp
@@ -140,7 +140,7 @@ WebSocket::WebSocket(ExecutionContext* context)
, m_subprotocol("")
, m_extensions("")
, m_stopped(false)
- , m_timerForDeferredDropProtection(this, &WebSocket::dropProtection)
+ , m_dropProtectionRunner(this, &WebSocket::dropProtection)
{
ScriptWrappable::init(this);
}
@@ -478,7 +478,7 @@ void WebSocket::resume()
m_channel->resume();
}
-void WebSocket::dropProtection(Timer<WebSocket>*)
+void WebSocket::dropProtection()
{
unsetPendingActivity(this);
}
@@ -505,9 +505,7 @@ void WebSocket::stop()
// instances. Deleting this WebSocket instance synchronously leads to
// ContextLifecycleNotifier::removeObserver() call which is prohibited
// to be called during iteration. Defer it.
- if (m_timerForDeferredDropProtection.isActive())
- return;
- m_timerForDeferredDropProtection.startOneShot(0);
+ m_dropProtectionRunner.runAsync();
}
void WebSocket::didConnect()

Powered by Google App Engine
This is Rietveld 408576698