| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/socket/websocket_endpoint_lock_manager.h" | 5 #include "net/socket/websocket_endpoint_lock_manager.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
| 13 #include "base/thread_task_runner_handle.h" | 13 #include "base/threading/thread_task_runner_handle.h" |
| 14 #include "net/base/net_errors.h" | 14 #include "net/base/net_errors.h" |
| 15 #include "net/log/net_log.h" | 15 #include "net/log/net_log.h" |
| 16 | 16 |
| 17 namespace net { | 17 namespace net { |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 // This delay prevents DoS attacks. | 21 // This delay prevents DoS attacks. |
| 22 // TODO(ricea): Replace this with randomised truncated exponential backoff. | 22 // TODO(ricea): Replace this with randomised truncated exponential backoff. |
| 23 // See crbug.com/377613. | 23 // See crbug.com/377613. |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 LockInfoMap::iterator lock_info_it) { | 163 LockInfoMap::iterator lock_info_it) { |
| 164 DVLOG(3) << "Removing (StreamSocket*)" << lock_info_it->second.socket | 164 DVLOG(3) << "Removing (StreamSocket*)" << lock_info_it->second.socket |
| 165 << " for " << lock_info_it->first.ToString() << " (" | 165 << " for " << lock_info_it->first.ToString() << " (" |
| 166 << socket_lock_info_map_.size() << " socket(s) left)"; | 166 << socket_lock_info_map_.size() << " socket(s) left)"; |
| 167 size_t erased = socket_lock_info_map_.erase(lock_info_it->second.socket); | 167 size_t erased = socket_lock_info_map_.erase(lock_info_it->second.socket); |
| 168 DCHECK_EQ(1U, erased); | 168 DCHECK_EQ(1U, erased); |
| 169 lock_info_it->second.socket = NULL; | 169 lock_info_it->second.socket = NULL; |
| 170 } | 170 } |
| 171 | 171 |
| 172 } // namespace net | 172 } // namespace net |
| OLD | NEW |