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

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

Issue 2652973002: [scheduler] Plumb websocket information to scheduler (Closed)
Patch Set: Removed include 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 c4b87bcbc67cbefe5733c1ec0cdcf568a9148f78..76f69c8c0020ec87c4a57a16b5b9e69b949425d1 100644
--- a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp
+++ b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp
@@ -46,6 +46,7 @@
#include "modules/websockets/WebSocketChannelClient.h"
#include "modules/websockets/WebSocketFrame.h"
#include "modules/websockets/WebSocketHandleImpl.h"
+#include "platform/WebFrameScheduler.h"
#include "platform/network/NetworkLog.h"
#include "platform/network/WebSocketHandshakeRequest.h"
#include "platform/weborigin/SecurityOrigin.h"
@@ -459,6 +460,10 @@ void DocumentWebSocketChannel::didConnect(WebSocketHandle* handle,
<< String(selectedProtocol) << ", " << String(extensions)
<< ")";
+ if (document()->frame()) {
+ document()->frame()->frameScheduler()->didOpenWebSocket();
+ }
alex clarke (OOO till 29th) 2017/01/24 18:15:33 nit: although I prefer the google3 style braces I
altimin 2017/01/24 18:39:04 Acknowledged.
+
DCHECK(m_handle);
DCHECK_EQ(handle, m_handle.get());
DCHECK(m_client);
@@ -503,6 +508,10 @@ void DocumentWebSocketChannel::didFail(WebSocketHandle* handle,
NETWORK_DVLOG(1) << this << " didFail(" << handle << ", " << String(message)
<< ")";
+ if (document()->frame()) {
+ document()->frame()->frameScheduler()->didCloseWebSocket();
+ }
alex clarke (OOO till 29th) 2017/01/24 18:15:33 Ditto.
altimin 2017/01/24 18:39:04 Acknowledged.
+
DCHECK(m_handle);
DCHECK_EQ(handle, m_handle.get());
@@ -585,6 +594,10 @@ void DocumentWebSocketChannel::didClose(WebSocketHandle* handle,
NETWORK_DVLOG(1) << this << " didClose(" << handle << ", " << wasClean << ", "
<< code << ", " << String(reason) << ")";
+ if (document()->frame()) {
+ document()->frame()->frameScheduler()->didCloseWebSocket();
+ }
+
DCHECK(m_handle);
DCHECK_EQ(handle, m_handle.get());

Powered by Google App Engine
This is Rietveld 408576698