// Copyright 2014 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef NET_SOCKET_WEBSOCKET_ENDPOINT_LOCK_MANAGER_H_ #define NET_SOCKET_WEBSOCKET_ENDPOINT_LOCK_MANAGER_H_ #include <stddef.h> #include <map> #include <memory> #include "base/containers/linked_list.h" #include "base/memory/raw_ptr.h" #include "base/time/time.h" #include "net/base/ip_endpoint.h" #include "net/base/net_export.h" #include "net/socket/websocket_transport_client_socket_pool.h" namespace net { // Keep track of ongoing WebSocket connections in order to satisfy the WebSocket // connection throttling requirements described in RFC6455 4.1.2: // // 2. If the client already has a WebSocket connection to the remote // host (IP address) identified by /host/ and port /port/ pair, even // if the remote host is known by another name, the client MUST wait // until that connection has been established or for that connection // to have failed. There MUST be no more than one connection in a // CONNECTING state. If multiple connections to the same IP address // are attempted simultaneously, the client MUST serialize them so // that there is no more than one connection at a time running // through the following steps. // class NET_EXPORT_PRIVATE WebSocketEndpointLockManager { … }; } // namespace net #endif // NET_SOCKET_WEBSOCKET_ENDPOINT_LOCK_MANAGER_H_