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

Unified Diff: chrome/browser/debugger/devtools_http_protocol_handler.cc

Issue 5986001: DevTools: a better fix for socket closure crash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years 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: chrome/browser/debugger/devtools_http_protocol_handler.cc
diff --git a/chrome/browser/debugger/devtools_http_protocol_handler.cc b/chrome/browser/debugger/devtools_http_protocol_handler.cc
index 9f239458a261b8c78dad3c1c8d19d7440262e644..1aaf18be6aae23c67708d7eaafb94831199d6837 100644
--- a/chrome/browser/debugger/devtools_http_protocol_handler.cc
+++ b/chrome/browser/debugger/devtools_http_protocol_handler.cc
@@ -263,13 +263,13 @@ void DevToolsHttpProtocolHandler::OnWebSocketMessageUI(
void DevToolsHttpProtocolHandler::OnCloseUI(HttpListenSocket* socket) {
SocketToClientHostMap::iterator it = socket_to_client_host_ui_.find(socket);
- if (it == socket_to_client_host_ui_.end())
- return;
- DevToolsClientHostImpl* client_host =
- static_cast<DevToolsClientHostImpl*>(it->second);
- client_host->NotifyCloseListener();
- delete client_host;
- socket_to_client_host_ui_.erase(socket);
+ if (it != socket_to_client_host_ui_.end()) {
+ DevToolsClientHostImpl* client_host =
+ static_cast<DevToolsClientHostImpl*>(it->second);
+ client_host->NotifyCloseListener();
+ delete client_host;
+ socket_to_client_host_ui_.erase(socket);
+ }
// We are holding last reference to scoped refptr 'socket' here.
// We can't exit method just like that since 'socket' is going to
« 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