Simplify traffic annotation usage

This commit is contained in:
klzgrad 2018-12-24 15:19:27 -05:00
parent 5976451086
commit 5ebf44568c
4 changed files with 8 additions and 8 deletions

View File

@ -23,9 +23,9 @@
#include "net/socket/next_proto.h" #include "net/socket/next_proto.h"
#include "net/socket/stream_socket.h" #include "net/socket/stream_socket.h"
#include "net/ssl/ssl_info.h" #include "net/ssl/ssl_info.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
namespace net { namespace net {
struct NetworkTrafficAnnotationTag;
// This StreamSocket is used to setup a HTTP CONNECT tunnel. // This StreamSocket is used to setup a HTTP CONNECT tunnel.
class HttpProxySocket : public StreamSocket { class HttpProxySocket : public StreamSocket {
@ -114,7 +114,7 @@ class HttpProxySocket : public StreamSocket {
NetLogWithSource net_log_; NetLogWithSource net_log_;
// Traffic annotation for socket control. // Traffic annotation for socket control.
NetworkTrafficAnnotationTag traffic_annotation_; const NetworkTrafficAnnotationTag& traffic_annotation_;
DISALLOW_COPY_AND_ASSIGN(HttpProxySocket); DISALLOW_COPY_AND_ASSIGN(HttpProxySocket);
}; };

View File

@ -15,7 +15,6 @@
#include "base/time/time.h" #include "base/time/time.h"
#include "net/base/completion_once_callback.h" #include "net/base/completion_once_callback.h"
#include "net/base/completion_repeating_callback.h" #include "net/base/completion_repeating_callback.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
namespace net { namespace net {
@ -23,6 +22,7 @@ class ClientSocketHandle;
class DrainableIOBuffer; class DrainableIOBuffer;
class IOBuffer; class IOBuffer;
class StreamSocket; class StreamSocket;
struct NetworkTrafficAnnotationTag;
class NaiveConnection { class NaiveConnection {
public: public:
@ -132,7 +132,7 @@ class NaiveConnection {
TimeFunc time_func_; TimeFunc time_func_;
// Traffic annotation for socket control. // Traffic annotation for socket control.
NetworkTrafficAnnotationTag traffic_annotation_; const NetworkTrafficAnnotationTag& traffic_annotation_;
base::WeakPtrFactory<NaiveConnection> weak_ptr_factory_; base::WeakPtrFactory<NaiveConnection> weak_ptr_factory_;

View File

@ -14,7 +14,6 @@
#include "net/base/completion_repeating_callback.h" #include "net/base/completion_repeating_callback.h"
#include "net/log/net_log_with_source.h" #include "net/log/net_log_with_source.h"
#include "net/tools/naive/naive_connection.h" #include "net/tools/naive/naive_connection.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
namespace net { namespace net {
@ -23,6 +22,7 @@ class HttpNetworkSession;
class NaiveConnection; class NaiveConnection;
class ServerSocket; class ServerSocket;
class StreamSocket; class StreamSocket;
struct NetworkTrafficAnnotationTag;
class NaiveProxy : public NaiveConnection::Delegate { class NaiveProxy : public NaiveConnection::Delegate {
public: public:
@ -73,7 +73,7 @@ class NaiveProxy : public NaiveConnection::Delegate {
std::map<unsigned int, std::unique_ptr<NaiveConnection>> connection_by_id_; std::map<unsigned int, std::unique_ptr<NaiveConnection>> connection_by_id_;
NetworkTrafficAnnotationTag traffic_annotation_; const NetworkTrafficAnnotationTag& traffic_annotation_;
base::WeakPtrFactory<NaiveProxy> weak_ptr_factory_; base::WeakPtrFactory<NaiveProxy> weak_ptr_factory_;

View File

@ -23,9 +23,9 @@
#include "net/socket/next_proto.h" #include "net/socket/next_proto.h"
#include "net/socket/stream_socket.h" #include "net/socket/stream_socket.h"
#include "net/ssl/ssl_info.h" #include "net/ssl/ssl_info.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
namespace net { namespace net {
struct NetworkTrafficAnnotationTag;
// This StreamSocket is used to setup a SOCKSv5 handshake with a socks client. // This StreamSocket is used to setup a SOCKSv5 handshake with a socks client.
// Currently no SOCKSv5 authentication is supported. // Currently no SOCKSv5 authentication is supported.
@ -164,7 +164,7 @@ class Socks5ServerSocket : public StreamSocket {
NetLogWithSource net_log_; NetLogWithSource net_log_;
// Traffic annotation for socket control. // Traffic annotation for socket control.
NetworkTrafficAnnotationTag traffic_annotation_; const NetworkTrafficAnnotationTag& traffic_annotation_;
DISALLOW_COPY_AND_ASSIGN(Socks5ServerSocket); DISALLOW_COPY_AND_ASSIGN(Socks5ServerSocket);
}; };