Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(409)

Unified Diff: net/socket/socks5_client_socket.cc

Issue 1696005: Add net log entries that summarize transmit and receive byte counts. (Closed)
Patch Set: More tests and address comments Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/socket/socks5_client_socket.h ('k') | net/socket/socks5_client_socket_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/socks5_client_socket.cc
diff --git a/net/socket/socks5_client_socket.cc b/net/socket/socks5_client_socket.cc
index eef3403967e948e1c428748d921c7fde67f01a48..c960b80e9198567167ad169ebf8df34da7f2919a 100644
--- a/net/socket/socks5_client_socket.cc
+++ b/net/socket/socks5_client_socket.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -59,7 +59,8 @@ SOCKS5ClientSocket::SOCKS5ClientSocket(
bytes_sent_(0),
bytes_received_(0),
read_header_size(kReadHeaderSize),
- host_request_info_(req_info) {
+ host_request_info_(req_info),
+ net_log_(transport_socket->socket()->NetLog()) {
}
SOCKS5ClientSocket::SOCKS5ClientSocket(
@@ -74,7 +75,8 @@ SOCKS5ClientSocket::SOCKS5ClientSocket(
bytes_sent_(0),
bytes_received_(0),
read_header_size(kReadHeaderSize),
- host_request_info_(req_info) {
+ host_request_info_(req_info),
+ net_log_(transport_socket->NetLog()) {
transport_->set_socket(transport_socket);
}
@@ -82,8 +84,7 @@ SOCKS5ClientSocket::~SOCKS5ClientSocket() {
Disconnect();
}
-int SOCKS5ClientSocket::Connect(CompletionCallback* callback,
- const BoundNetLog& net_log) {
+int SOCKS5ClientSocket::Connect(CompletionCallback* callback) {
DCHECK(transport_.get());
DCHECK(transport_->socket());
DCHECK(transport_->socket()->IsConnected());
@@ -94,8 +95,7 @@ int SOCKS5ClientSocket::Connect(CompletionCallback* callback,
if (completed_handshake_)
return OK;
- net_log_ = net_log;
- net_log.BeginEvent(NetLog::TYPE_SOCKS5_CONNECT);
+ net_log_.BeginEvent(NetLog::TYPE_SOCKS5_CONNECT);
next_state_ = STATE_GREET_WRITE;
buffer_.clear();
@@ -104,8 +104,7 @@ int SOCKS5ClientSocket::Connect(CompletionCallback* callback,
if (rv == ERR_IO_PENDING) {
user_callback_ = callback;
} else {
- net_log.EndEvent(NetLog::TYPE_SOCKS5_CONNECT);
- net_log_ = BoundNetLog();
+ net_log_.EndEvent(NetLog::TYPE_SOCKS5_CONNECT);
}
return rv;
}
@@ -118,7 +117,6 @@ void SOCKS5ClientSocket::Disconnect() {
// These are the states initialized by Connect().
next_state_ = STATE_NONE;
user_callback_ = NULL;
- net_log_ = BoundNetLog();
}
bool SOCKS5ClientSocket::IsConnected() const {
@@ -175,7 +173,6 @@ void SOCKS5ClientSocket::OnIOComplete(int result) {
int rv = DoLoop(result);
if (rv != ERR_IO_PENDING) {
net_log_.EndEvent(NetLog::TYPE_SOCKS5_CONNECT);
- net_log_ = BoundNetLog();
DoCallback(rv);
}
}
« no previous file with comments | « net/socket/socks5_client_socket.h ('k') | net/socket/socks5_client_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698