From b2877a4aad170ff18f44d55dc6bfa312f5201235 Mon Sep 17 00:00:00 2001 From: klzgrad Date: Mon, 24 Dec 2018 15:19:27 -0500 Subject: [PATCH] Simplify traffic annotation usage --- src/net/tools/naive/http_proxy_socket.h | 4 ++-- src/net/tools/naive/naive_connection.h | 4 ++-- src/net/tools/naive/naive_proxy.h | 4 ++-- src/net/tools/naive/socks5_server_socket.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/net/tools/naive/http_proxy_socket.h b/src/net/tools/naive/http_proxy_socket.h index 85888eee8a..7063182571 100644 --- a/src/net/tools/naive/http_proxy_socket.h +++ b/src/net/tools/naive/http_proxy_socket.h @@ -23,9 +23,9 @@ #include "net/socket/next_proto.h" #include "net/socket/stream_socket.h" #include "net/ssl/ssl_info.h" -#include "net/traffic_annotation/network_traffic_annotation.h" namespace net { +struct NetworkTrafficAnnotationTag; // This StreamSocket is used to setup a HTTP CONNECT tunnel. class HttpProxySocket : public StreamSocket { @@ -114,7 +114,7 @@ class HttpProxySocket : public StreamSocket { NetLogWithSource net_log_; // Traffic annotation for socket control. - NetworkTrafficAnnotationTag traffic_annotation_; + const NetworkTrafficAnnotationTag& traffic_annotation_; DISALLOW_COPY_AND_ASSIGN(HttpProxySocket); }; diff --git a/src/net/tools/naive/naive_connection.h b/src/net/tools/naive/naive_connection.h index 82239916a6..89a92cb856 100644 --- a/src/net/tools/naive/naive_connection.h +++ b/src/net/tools/naive/naive_connection.h @@ -15,7 +15,6 @@ #include "base/time/time.h" #include "net/base/completion_once_callback.h" #include "net/base/completion_repeating_callback.h" -#include "net/traffic_annotation/network_traffic_annotation.h" namespace net { @@ -23,6 +22,7 @@ class ClientSocketHandle; class DrainableIOBuffer; class IOBuffer; class StreamSocket; +struct NetworkTrafficAnnotationTag; class NaiveConnection { public: @@ -132,7 +132,7 @@ class NaiveConnection { TimeFunc time_func_; // Traffic annotation for socket control. - NetworkTrafficAnnotationTag traffic_annotation_; + const NetworkTrafficAnnotationTag& traffic_annotation_; base::WeakPtrFactory weak_ptr_factory_; diff --git a/src/net/tools/naive/naive_proxy.h b/src/net/tools/naive/naive_proxy.h index 3b97bb07b9..877dfdd973 100644 --- a/src/net/tools/naive/naive_proxy.h +++ b/src/net/tools/naive/naive_proxy.h @@ -14,7 +14,6 @@ #include "net/base/completion_repeating_callback.h" #include "net/log/net_log_with_source.h" #include "net/tools/naive/naive_connection.h" -#include "net/traffic_annotation/network_traffic_annotation.h" namespace net { @@ -23,6 +22,7 @@ class HttpNetworkSession; class NaiveConnection; class ServerSocket; class StreamSocket; +struct NetworkTrafficAnnotationTag; class NaiveProxy : public NaiveConnection::Delegate { public: @@ -73,7 +73,7 @@ class NaiveProxy : public NaiveConnection::Delegate { std::map> connection_by_id_; - NetworkTrafficAnnotationTag traffic_annotation_; + const NetworkTrafficAnnotationTag& traffic_annotation_; base::WeakPtrFactory weak_ptr_factory_; diff --git a/src/net/tools/naive/socks5_server_socket.h b/src/net/tools/naive/socks5_server_socket.h index 18848bd628..30deb36960 100644 --- a/src/net/tools/naive/socks5_server_socket.h +++ b/src/net/tools/naive/socks5_server_socket.h @@ -23,9 +23,9 @@ #include "net/socket/next_proto.h" #include "net/socket/stream_socket.h" #include "net/ssl/ssl_info.h" -#include "net/traffic_annotation/network_traffic_annotation.h" namespace net { +struct NetworkTrafficAnnotationTag; // This StreamSocket is used to setup a SOCKSv5 handshake with a socks client. // Currently no SOCKSv5 authentication is supported. @@ -164,7 +164,7 @@ class Socks5ServerSocket : public StreamSocket { NetLogWithSource net_log_; // Traffic annotation for socket control. - NetworkTrafficAnnotationTag traffic_annotation_; + const NetworkTrafficAnnotationTag& traffic_annotation_; DISALLOW_COPY_AND_ASSIGN(Socks5ServerSocket); };