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

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

Issue 2312573002: Revert of Remove a Platform::current() check from Mojo's error handler in WebSocket (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: temp Created 4 years, 3 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: third_party/WebKit/Source/modules/websockets/WebSocketHandleImpl.cpp
diff --git a/third_party/WebKit/Source/modules/websockets/WebSocketHandleImpl.cpp b/third_party/WebKit/Source/modules/websockets/WebSocketHandleImpl.cpp
index 3748b0f9644de331e5196dbd0a29463dffd74718..304b9e7f50b5479d98d559115708b264ecf3d726 100644
--- a/third_party/WebKit/Source/modules/websockets/WebSocketHandleImpl.cpp
+++ b/third_party/WebKit/Source/modules/websockets/WebSocketHandleImpl.cpp
@@ -124,6 +124,15 @@ void WebSocketHandleImpl::disconnect()
void WebSocketHandleImpl::onConnectionError()
{
+ if (!blink::Platform::current()) {
+ // In the renderrer shutdown sequence, mojo channels are destructed and this
+ // function is called. On the other hand, blink objects became invalid
+ // *silently*, which means we must not touch |*client_| any more.
+ // TODO(yhirano): Remove this code once the shutdown sequence is fixed.
+ disconnect();
+ return;
+ }
+
// Our connection to the WebSocket was dropped. This could be due to
// exceeding the maximum number of concurrent websockets from this process.
« 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