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

Unified Diff: net/socket/socks5_client_socket.cc

Issue 10546162: NetLogEventParameter to Callback refactoring 9. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Update comment Created 8 years, 6 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
Index: net/socket/socks5_client_socket.cc
===================================================================
--- net/socket/socks5_client_socket.cc (revision 142108)
+++ net/socket/socks5_client_socket.cc (working copy)
@@ -74,7 +74,7 @@
if (completed_handshake_)
return OK;
- net_log_.BeginEvent(NetLog::TYPE_SOCKS5_CONNECT, NULL);
+ net_log_.BeginEvent(NetLog::TYPE_SOCKS5_CONNECT);
next_state_ = STATE_GREET_WRITE;
buffer_.clear();
@@ -211,7 +211,7 @@
DCHECK_NE(STATE_NONE, next_state_);
int rv = DoLoop(result);
if (rv != ERR_IO_PENDING) {
- net_log_.EndEvent(NetLog::TYPE_SOCKS5_CONNECT, NULL);
+ net_log_.EndEvent(NetLog::TYPE_SOCKS5_CONNECT);
DoCallback(rv);
}
}
@@ -225,7 +225,7 @@
switch (state) {
case STATE_GREET_WRITE:
DCHECK_EQ(OK, rv);
- net_log_.BeginEvent(NetLog::TYPE_SOCKS5_GREET_WRITE, NULL);
+ net_log_.BeginEvent(NetLog::TYPE_SOCKS5_GREET_WRITE);
rv = DoGreetWrite();
break;
case STATE_GREET_WRITE_COMPLETE:
@@ -234,7 +234,7 @@
break;
case STATE_GREET_READ:
DCHECK_EQ(OK, rv);
- net_log_.BeginEvent(NetLog::TYPE_SOCKS5_GREET_READ, NULL);
+ net_log_.BeginEvent(NetLog::TYPE_SOCKS5_GREET_READ);
rv = DoGreetRead();
break;
case STATE_GREET_READ_COMPLETE:
@@ -243,7 +243,7 @@
break;
case STATE_HANDSHAKE_WRITE:
DCHECK_EQ(OK, rv);
- net_log_.BeginEvent(NetLog::TYPE_SOCKS5_HANDSHAKE_WRITE, NULL);
+ net_log_.BeginEvent(NetLog::TYPE_SOCKS5_HANDSHAKE_WRITE);
rv = DoHandshakeWrite();
break;
case STATE_HANDSHAKE_WRITE_COMPLETE:
@@ -253,7 +253,7 @@
break;
case STATE_HANDSHAKE_READ:
DCHECK_EQ(OK, rv);
- net_log_.BeginEvent(NetLog::TYPE_SOCKS5_HANDSHAKE_READ, NULL);
+ net_log_.BeginEvent(NetLog::TYPE_SOCKS5_HANDSHAKE_READ);
rv = DoHandshakeRead();
break;
case STATE_HANDSHAKE_READ_COMPLETE:
@@ -277,7 +277,7 @@
// Since we only have 1 byte to send the hostname length in, if the
// URL has a hostname longer than 255 characters we can't send it.
if (0xFF < host_request_info_.hostname().size()) {
- net_log_.AddEvent(NetLog::TYPE_SOCKS_HOSTNAME_TOO_BIG, NULL);
+ net_log_.AddEvent(NetLog::TYPE_SOCKS_HOSTNAME_TOO_BIG);
return ERR_SOCKS_CONNECTION_FAILED;
}
@@ -324,8 +324,7 @@
return result;
if (result == 0) {
- net_log_.AddEvent(NetLog::TYPE_SOCKS_UNEXPECTEDLY_CLOSED_DURING_GREETING,
- NULL);
+ net_log_.AddEvent(NetLog::TYPE_SOCKS_UNEXPECTEDLY_CLOSED_DURING_GREETING);
return ERR_SOCKS_CONNECTION_FAILED;
}
@@ -338,15 +337,13 @@
// Got the greet data.
if (buffer_[0] != kSOCKS5Version) {
- net_log_.AddEvent(
- NetLog::TYPE_SOCKS_UNEXPECTED_VERSION,
- make_scoped_refptr(new NetLogIntegerParameter("version", buffer_[0])));
+ net_log_.AddEvent(NetLog::TYPE_SOCKS_UNEXPECTED_VERSION,
+ NetLog::IntegerCallback("version", buffer_[0]));
return ERR_SOCKS_CONNECTION_FAILED;
}
if (buffer_[1] != 0x00) {
- net_log_.AddEvent(
- NetLog::TYPE_SOCKS_UNEXPECTED_AUTH,
- make_scoped_refptr(new NetLogIntegerParameter("method", buffer_[1])));
+ net_log_.AddEvent(NetLog::TYPE_SOCKS_UNEXPECTED_AUTH,
+ NetLog::IntegerCallback("method", buffer_[1]));
return ERR_SOCKS_CONNECTION_FAILED;
}
@@ -437,8 +434,7 @@
// The underlying socket closed unexpectedly.
if (result == 0) {
- net_log_.AddEvent(NetLog::TYPE_SOCKS_UNEXPECTEDLY_CLOSED_DURING_HANDSHAKE,
- NULL);
+ net_log_.AddEvent(NetLog::TYPE_SOCKS_UNEXPECTEDLY_CLOSED_DURING_HANDSHAKE);
return ERR_SOCKS_CONNECTION_FAILED;
}
@@ -449,17 +445,13 @@
// and accordingly increase them
if (bytes_received_ == kReadHeaderSize) {
if (buffer_[0] != kSOCKS5Version || buffer_[2] != kNullByte) {
- net_log_.AddEvent(
- NetLog::TYPE_SOCKS_UNEXPECTED_VERSION,
- make_scoped_refptr(
- new NetLogIntegerParameter("version", buffer_[0])));
+ net_log_.AddEvent(NetLog::TYPE_SOCKS_UNEXPECTED_VERSION,
+ NetLog::IntegerCallback("version", buffer_[0]));
return ERR_SOCKS_CONNECTION_FAILED;
}
if (buffer_[1] != 0x00) {
- net_log_.AddEvent(
- NetLog::TYPE_SOCKS_SERVER_ERROR,
- make_scoped_refptr(
- new NetLogIntegerParameter("error_code", buffer_[1])));
+ net_log_.AddEvent(NetLog::TYPE_SOCKS_SERVER_ERROR,
+ NetLog::IntegerCallback("error_code", buffer_[1]));
return ERR_SOCKS_CONNECTION_FAILED;
}
@@ -477,10 +469,8 @@
else if (address_type == kEndPointResolvedIPv6)
read_header_size += sizeof(struct in6_addr) - 1;
else {
- net_log_.AddEvent(
- NetLog::TYPE_SOCKS_UNKNOWN_ADDRESS_TYPE,
- make_scoped_refptr(
- new NetLogIntegerParameter("address_type", buffer_[3])));
+ net_log_.AddEvent(NetLog::TYPE_SOCKS_UNKNOWN_ADDRESS_TYPE,
+ NetLog::IntegerCallback("address_type", buffer_[3]));
return ERR_SOCKS_CONNECTION_FAILED;
}

Powered by Google App Engine
This is Rietveld 408576698