Commit 33a4e43a authored by Bence Béky's avatar Bence Béky Committed by Commit Bot

Change HttpNetworkSession::websocket_endpoint_lock_manager_ type.

Change type of HttpNetworkSession::websocket_endpoint_lock_manager_ from
unique_ptr<WebSocketEndpointLockManager> to
WebSocketEndpointLockManager.  This member object is constructed upon
HttpNetworkSession construction and is never explicitly destroyed (only
implicitly when the unique_ptr goes out of scope upon HttpNetworkSession
destruction).  The same lifetime can be achieved with a
WebSocketEndpointLockManager member.

It is possible though not particularily likely that this will solve
https://crbug.com/908734, but since the cause of that crash is not
known, it is worth trying.  This CL is an improvement regardless.

Bug: 908734
Change-Id: Iddd2117dc5256e06672ae2964ad7cfebefe76fe0
Reviewed-on: https://chromium-review.googlesource.com/c/1356862Reviewed-by: default avatarAdam Rice <ricea@chromium.org>
Commit-Queue: Bence Béky <bnc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#613110}
parent d51a9ef1
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
#include "net/socket/client_socket_pool_manager_impl.h" #include "net/socket/client_socket_pool_manager_impl.h"
#include "net/socket/next_proto.h" #include "net/socket/next_proto.h"
#include "net/socket/ssl_client_socket.h" #include "net/socket/ssl_client_socket.h"
#include "net/socket/websocket_endpoint_lock_manager.h"
#include "net/spdy/spdy_session_pool.h" #include "net/spdy/spdy_session_pool.h"
#include "net/third_party/quic/core/crypto/quic_random.h" #include "net/third_party/quic/core/crypto/quic_random.h"
#include "net/third_party/quic/core/quic_packets.h" #include "net/third_party/quic/core/quic_packets.h"
...@@ -193,8 +192,6 @@ HttpNetworkSession::HttpNetworkSession(const Params& params, ...@@ -193,8 +192,6 @@ HttpNetworkSession::HttpNetworkSession(const Params& params,
#endif #endif
proxy_resolution_service_(context.proxy_resolution_service), proxy_resolution_service_(context.proxy_resolution_service),
ssl_config_service_(context.ssl_config_service), ssl_config_service_(context.ssl_config_service),
websocket_endpoint_lock_manager_(
std::make_unique<WebSocketEndpointLockManager>()),
push_delegate_(nullptr), push_delegate_(nullptr),
quic_stream_factory_( quic_stream_factory_(
context.net_log, context.net_log,
...@@ -262,10 +259,10 @@ HttpNetworkSession::HttpNetworkSession(const Params& params, ...@@ -262,10 +259,10 @@ HttpNetworkSession::HttpNetworkSession(const Params& params,
"http_network_session/" + base::IntToString(g_next_shard_id.GetNext()); "http_network_session/" + base::IntToString(g_next_shard_id.GetNext());
normal_socket_pool_manager_ = CreateSocketPoolManager( normal_socket_pool_manager_ = CreateSocketPoolManager(
NORMAL_SOCKET_POOL, context, ssl_session_cache_shard, NORMAL_SOCKET_POOL, context, ssl_session_cache_shard,
websocket_endpoint_lock_manager_.get()); &websocket_endpoint_lock_manager_);
websocket_socket_pool_manager_ = CreateSocketPoolManager( websocket_socket_pool_manager_ = CreateSocketPoolManager(
WEBSOCKET_SOCKET_POOL, context, ssl_session_cache_shard, WEBSOCKET_SOCKET_POOL, context, ssl_session_cache_shard,
websocket_endpoint_lock_manager_.get()); &websocket_endpoint_lock_manager_);
if (params_.enable_http2) { if (params_.enable_http2) {
next_protos_.push_back(kProtoHTTP2); next_protos_.push_back(kProtoHTTP2);
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "net/net_buildflags.h" #include "net/net_buildflags.h"
#include "net/quic/quic_stream_factory.h" #include "net/quic/quic_stream_factory.h"
#include "net/socket/next_proto.h" #include "net/socket/next_proto.h"
#include "net/socket/websocket_endpoint_lock_manager.h"
#include "net/spdy/spdy_session_pool.h" #include "net/spdy/spdy_session_pool.h"
#include "net/ssl/ssl_client_auth_cache.h" #include "net/ssl/ssl_client_auth_cache.h"
#include "net/third_party/spdy/core/spdy_protocol.h" #include "net/third_party/spdy/core/spdy_protocol.h"
...@@ -43,6 +44,10 @@ class ProcessMemoryDump; ...@@ -43,6 +44,10 @@ class ProcessMemoryDump;
} }
} }
namespace quic {
class QuicClock;
} // namespace quic
namespace net { namespace net {
class CTPolicyEnforcer; class CTPolicyEnforcer;
...@@ -66,11 +71,6 @@ class ProxyResolutionService; ...@@ -66,11 +71,6 @@ class ProxyResolutionService;
#if BUILDFLAG(ENABLE_REPORTING) #if BUILDFLAG(ENABLE_REPORTING)
class ReportingService; class ReportingService;
#endif #endif
} // namespace net
namespace quic {
class QuicClock;
} // namespace quic
namespace net {
class QuicCryptoClientStreamFactory; class QuicCryptoClientStreamFactory;
class SocketPerformanceWatcherFactory; class SocketPerformanceWatcherFactory;
class SOCKSClientSocketPool; class SOCKSClientSocketPool;
...@@ -78,7 +78,6 @@ class SSLClientSocketPool; ...@@ -78,7 +78,6 @@ class SSLClientSocketPool;
class SSLConfigService; class SSLConfigService;
class TransportClientSocketPool; class TransportClientSocketPool;
class TransportSecurityState; class TransportSecurityState;
class WebSocketEndpointLockManager;
// Specifies the maximum HPACK dynamic table size the server is allowed to set. // Specifies the maximum HPACK dynamic table size the server is allowed to set.
const uint32_t kSpdyMaxHeaderTableSize = 64 * 1024; const uint32_t kSpdyMaxHeaderTableSize = 64 * 1024;
...@@ -316,7 +315,7 @@ class NET_EXPORT HttpNetworkSession { ...@@ -316,7 +315,7 @@ class NET_EXPORT HttpNetworkSession {
} }
SSLConfigService* ssl_config_service() { return ssl_config_service_; } SSLConfigService* ssl_config_service() { return ssl_config_service_; }
WebSocketEndpointLockManager* websocket_endpoint_lock_manager() { WebSocketEndpointLockManager* websocket_endpoint_lock_manager() {
return websocket_endpoint_lock_manager_.get(); return &websocket_endpoint_lock_manager_;
} }
SpdySessionPool* spdy_session_pool() { return &spdy_session_pool_; } SpdySessionPool* spdy_session_pool() { return &spdy_session_pool_; }
QuicStreamFactory* quic_stream_factory() { return &quic_stream_factory_; } QuicStreamFactory* quic_stream_factory() { return &quic_stream_factory_; }
...@@ -404,8 +403,7 @@ class NET_EXPORT HttpNetworkSession { ...@@ -404,8 +403,7 @@ class NET_EXPORT HttpNetworkSession {
HttpAuthCache http_auth_cache_; HttpAuthCache http_auth_cache_;
SSLClientAuthCache ssl_client_auth_cache_; SSLClientAuthCache ssl_client_auth_cache_;
std::unique_ptr<WebSocketEndpointLockManager> WebSocketEndpointLockManager websocket_endpoint_lock_manager_;
websocket_endpoint_lock_manager_;
std::unique_ptr<ClientSocketPoolManager> normal_socket_pool_manager_; std::unique_ptr<ClientSocketPoolManager> normal_socket_pool_manager_;
std::unique_ptr<ClientSocketPoolManager> websocket_socket_pool_manager_; std::unique_ptr<ClientSocketPoolManager> websocket_socket_pool_manager_;
std::unique_ptr<ServerPushDelegate> push_delegate_; std::unique_ptr<ServerPushDelegate> push_delegate_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment