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

Unified Diff: third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp

Issue 2652973002: [scheduler] Plumb websocket information to scheduler (Closed)
Patch Set: Introduce WebFrameScheduler::ActiveConnectionHandle Created 3 years, 11 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: third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp
diff --git a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp
index a06f14070bc39a7dbd316781550ee876e82e72c2..fa85847feb887d172174fb0bda9716bf4c29c202 100644
--- a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp
+++ b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp
@@ -45,6 +45,7 @@
#include "modules/websockets/WebSocketChannelClient.h"
#include "modules/websockets/WebSocketFrame.h"
#include "modules/websockets/WebSocketHandleImpl.h"
+#include "platform/WebFrameScheduler.h"
#include "platform/loader/fetch/UniqueIdentifier.h"
#include "platform/network/NetworkLog.h"
#include "platform/network/WebSocketHandshakeRequest.h"
@@ -459,6 +460,11 @@ void DocumentWebSocketChannel::didConnect(WebSocketHandle* handle,
<< String(selectedProtocol) << ", " << String(extensions)
<< ")";
+ if (document()->frame()) {
+ connection_handle_for_scheduler_ =
+ document()->frame()->frameScheduler()->onActiveConnectionCreated();
+ }
+
DCHECK(m_handle);
DCHECK_EQ(handle, m_handle.get());
DCHECK(m_client);
@@ -503,6 +509,8 @@ void DocumentWebSocketChannel::didFail(WebSocketHandle* handle,
NETWORK_DVLOG(1) << this << " didFail(" << handle << ", " << String(message)
<< ")";
+ connection_handle_for_scheduler_.reset();
+
DCHECK(m_handle);
DCHECK_EQ(handle, m_handle.get());
@@ -585,6 +593,8 @@ void DocumentWebSocketChannel::didClose(WebSocketHandle* handle,
NETWORK_DVLOG(1) << this << " didClose(" << handle << ", " << wasClean << ", "
<< code << ", " << String(reason) << ")";
+ connection_handle_for_scheduler_.reset();
+
DCHECK(m_handle);
DCHECK_EQ(handle, m_handle.get());

Powered by Google App Engine
This is Rietveld 408576698