summaryrefslogtreecommitdiff
path: root/chromium/net/socket/client_socket_handle.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/net/socket/client_socket_handle.h')
-rw-r--r--chromium/net/socket/client_socket_handle.h42
1 files changed, 23 insertions, 19 deletions
diff --git a/chromium/net/socket/client_socket_handle.h b/chromium/net/socket/client_socket_handle.h
index b20e4c75c3d..2ac9d88c195 100644
--- a/chromium/net/socket/client_socket_handle.h
+++ b/chromium/net/socket/client_socket_handle.h
@@ -13,6 +13,7 @@
#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
+#include "base/optional.h"
#include "base/time/time.h"
#include "net/base/ip_endpoint.h"
#include "net/base/load_states.h"
@@ -30,6 +31,7 @@
namespace net {
class ConnectJob;
+struct NetworkTrafficAnnotationTag;
class SocketTag;
// A container for a StreamSocket.
@@ -79,15 +81,17 @@ class NET_EXPORT ClientSocketHandle {
// Init may be called multiple times.
//
// Profiling information for the request is saved to |net_log| if non-NULL.
- int Init(const ClientSocketPool::GroupId& group_id,
- scoped_refptr<ClientSocketPool::SocketParams> socket_params,
- RequestPriority priority,
- const SocketTag& socket_tag,
- ClientSocketPool::RespectLimits respect_limits,
- CompletionOnceCallback callback,
- const ClientSocketPool::ProxyAuthCallback& proxy_auth_callback,
- ClientSocketPool* pool,
- const NetLogWithSource& net_log);
+ int Init(
+ const ClientSocketPool::GroupId& group_id,
+ scoped_refptr<ClientSocketPool::SocketParams> socket_params,
+ const base::Optional<NetworkTrafficAnnotationTag>& proxy_annotation_tag,
+ RequestPriority priority,
+ const SocketTag& socket_tag,
+ ClientSocketPool::RespectLimits respect_limits,
+ CompletionOnceCallback callback,
+ const ClientSocketPool::ProxyAuthCallback& proxy_auth_callback,
+ ClientSocketPool* pool,
+ const NetLogWithSource& net_log);
// Changes the priority of the ClientSocketHandle to the passed value.
// This function is a no-op if |priority| is the same as the current
@@ -105,6 +109,11 @@ class NET_EXPORT ClientSocketHandle {
// StreamSocket.
void Reset();
+ // Like Reset(), but also closes the socket (if there is one) and cancels any
+ // pending attempt to establish a connection, if the connection attempt is
+ // still ongoing.
+ void ResetAndCloseSocket();
+
// Used after Init() is called, but before the ClientSocketPool has
// initialized the ClientSocketHandle.
LoadState GetLoadState() const;
@@ -160,9 +169,6 @@ class NET_EXPORT ClientSocketHandle {
scoped_refptr<SSLCertRequestInfo> ssl_cert_request_info) {
ssl_cert_request_info_ = std::move(ssl_cert_request_info);
}
- void set_pending_http_proxy_socket(std::unique_ptr<StreamSocket> socket) {
- pending_http_proxy_socket_ = std::move(socket);
- }
void set_connection_attempts(const ConnectionAttempts& attempts) {
connection_attempts_ = attempts;
}
@@ -179,10 +185,6 @@ class NET_EXPORT ClientSocketHandle {
return ssl_cert_request_info_;
}
- std::unique_ptr<StreamSocket> release_pending_http_proxy_socket() {
- return std::move(pending_http_proxy_socket_);
- }
-
// If the connection failed, returns the connection attempts made. (If it
// succeeded, they will be returned through the socket instead; see
// |StreamSocket::GetConnectionAttempts|.)
@@ -219,8 +221,11 @@ class NET_EXPORT ClientSocketHandle {
// Resets the state of the ClientSocketHandle. |cancel| indicates whether or
// not to try to cancel the request with the ClientSocketPool. Does not
- // reset the supplemental error state.
- void ResetInternal(bool cancel);
+ // reset the supplemental error state. |cancel_connect_job| indicates whether
+ // a pending ConnectJob, if there is one in the SocketPool, should be
+ // cancelled in addition to cancelling the request. It may only be true if
+ // |cancel| is also true.
+ void ResetInternal(bool cancel, bool cancel_connect_job);
// Resets the supplemental error state.
void ResetErrorState();
@@ -237,7 +242,6 @@ class NET_EXPORT ClientSocketHandle {
int64_t group_generation_;
bool is_ssl_error_;
scoped_refptr<SSLCertRequestInfo> ssl_cert_request_info_;
- std::unique_ptr<StreamSocket> pending_http_proxy_socket_;
std::vector<ConnectionAttempt> connection_attempts_;
NetLogSource requesting_source_;