summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortfarina <tfarina@chromium.org>2015-10-27 06:11:28 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-27 13:12:21 +0000
commit5e24b244240f658e2c39b86538571d90b670b041 (patch)
tree053a49a32fe620cefe100a97c2a47161e7e670ca
parenta3bbe0a41c63d27cb4995c2a211421939af7dde8 (diff)
downloadchromium_src-5e24b244240f658e2c39b86538571d90b670b041.zip
chromium_src-5e24b244240f658e2c39b86538571d90b670b041.tar.gz
chromium_src-5e24b244240f658e2c39b86538571d90b670b041.tar.bz2
net: Rename NetLog's IntegerCallback method to IntCallback.
This fixes mmenke's TODO for it. BUG=None R=mmenke@chromium.org,eroman@chromium.org Review URL: https://codereview.chromium.org/1424733004 Cr-Commit-Position: refs/heads/master@{#356279}
-rw-r--r--net/dns/host_resolver_impl.cc8
-rw-r--r--net/log/net_log.cc11
-rw-r--r--net/log/net_log.h3
-rw-r--r--net/proxy/multi_threaded_proxy_resolver.cc2
-rw-r--r--net/quic/quic_chromium_client_session.cc2
-rw-r--r--net/socket/client_socket_pool_base.cc9
-rw-r--r--net/socket/socks5_client_socket.cc10
-rw-r--r--net/socket/ssl_client_socket_nss.cc9
-rw-r--r--net/socket/ssl_client_socket_openssl.cc4
-rw-r--r--net/socket/tcp_socket_posix.cc2
-rw-r--r--net/socket/tcp_socket_win.cc2
-rw-r--r--net/spdy/spdy_session.cc8
-rw-r--r--net/spdy/spdy_stream.cc2
-rw-r--r--net/url_request/url_request.cc2
14 files changed, 34 insertions, 40 deletions
diff --git a/net/dns/host_resolver_impl.cc b/net/dns/host_resolver_impl.cc
index 8692fcd..09713ba 100644
--- a/net/dns/host_resolver_impl.cc
+++ b/net/dns/host_resolver_impl.cc
@@ -675,9 +675,8 @@ class HostResolverImpl::ProcTask
return;
}
- net_log_.AddEvent(
- NetLog::TYPE_HOST_RESOLVER_IMPL_ATTEMPT_STARTED,
- NetLog::IntegerCallback("attempt_number", attempt_number_));
+ net_log_.AddEvent(NetLog::TYPE_HOST_RESOLVER_IMPL_ATTEMPT_STARTED,
+ NetLog::IntCallback("attempt_number", attempt_number_));
// If we don't get the results within a given time, RetryIfNotComplete
// will start a new attempt on a different worker thread if none of our
@@ -777,8 +776,7 @@ class HostResolverImpl::ProcTask
error,
os_error);
} else {
- net_log_callback = NetLog::IntegerCallback("attempt_number",
- attempt_number);
+ net_log_callback = NetLog::IntCallback("attempt_number", attempt_number);
}
net_log_.AddEvent(NetLog::TYPE_HOST_RESOLVER_IMPL_ATTEMPT_FINISHED,
net_log_callback);
diff --git a/net/log/net_log.cc b/net/log/net_log.cc
index def248d..79a8886 100644
--- a/net/log/net_log.cc
+++ b/net/log/net_log.cc
@@ -51,7 +51,7 @@ scoped_ptr<base::Value> NetLogBoolCallback(
return event_params.Pass();
}
-scoped_ptr<base::Value> NetLogIntegerCallback(
+scoped_ptr<base::Value> NetLogIntCallback(
const char* name,
int value,
NetLogCaptureMode /* capture_mode */) {
@@ -347,9 +347,8 @@ NetLog::ParametersCallback NetLog::BoolCallback(const char* name, bool value) {
}
// static
-NetLog::ParametersCallback NetLog::IntegerCallback(const char* name,
- int value) {
- return base::Bind(&NetLogIntegerCallback, name, value);
+NetLog::ParametersCallback NetLog::IntCallback(const char* name, int value) {
+ return base::Bind(&NetLogIntCallback, name, value);
}
// static
@@ -446,7 +445,7 @@ void BoundNetLog::AddEventWithNetErrorCode(NetLog::EventType event_type,
if (net_error >= 0) {
AddEvent(event_type);
} else {
- AddEvent(event_type, NetLog::IntegerCallback("net_error", net_error));
+ AddEvent(event_type, NetLog::IntCallback("net_error", net_error));
}
}
@@ -456,7 +455,7 @@ void BoundNetLog::EndEventWithNetErrorCode(NetLog::EventType event_type,
if (net_error >= 0) {
EndEvent(event_type);
} else {
- EndEvent(event_type, NetLog::IntegerCallback("net_error", net_error));
+ EndEvent(event_type, NetLog::IntCallback("net_error", net_error));
}
}
diff --git a/net/log/net_log.h b/net/log/net_log.h
index 7104022..1b3f27c 100644
--- a/net/log/net_log.h
+++ b/net/log/net_log.h
@@ -268,8 +268,7 @@ class NET_EXPORT NetLog {
static ParametersCallback BoolCallback(const char* name, bool value);
// Warning: |name| must remain valid for the life of the callback.
- // TODO(mmenke): Rename this to be consistent with Int64Callback.
- static ParametersCallback IntegerCallback(const char* name, int value);
+ static ParametersCallback IntCallback(const char* name, int value);
// Creates a ParametersCallback that encapsulates a single int64. The
// callback will return the value as a StringValue, since IntegerValues
diff --git a/net/proxy/multi_threaded_proxy_resolver.cc b/net/proxy/multi_threaded_proxy_resolver.cc
index 6c6fa69..7f03bbf 100644
--- a/net/proxy/multi_threaded_proxy_resolver.cc
+++ b/net/proxy/multi_threaded_proxy_resolver.cc
@@ -305,7 +305,7 @@ class MultiThreadedProxyResolver::GetProxyForURLJob : public Job {
net_log_.AddEvent(
NetLog::TYPE_SUBMITTED_TO_RESOLVER_THREAD,
- NetLog::IntegerCallback("thread_number", executor()->thread_number()));
+ NetLog::IntCallback("thread_number", executor()->thread_number()));
}
// Runs on the worker thread.
diff --git a/net/quic/quic_chromium_client_session.cc b/net/quic/quic_chromium_client_session.cc
index a03944f..c5b49a0 100644
--- a/net/quic/quic_chromium_client_session.cc
+++ b/net/quic/quic_chromium_client_session.cc
@@ -836,7 +836,7 @@ void QuicChromiumClientSession::CloseSessionOnErrorInner(
CloseAllStreams(net_error);
CloseAllObservers(net_error);
net_log_.AddEvent(NetLog::TYPE_QUIC_SESSION_CLOSE_ON_ERROR,
- NetLog::IntegerCallback("net_error", net_error));
+ NetLog::IntCallback("net_error", net_error));
if (connection()->connected())
connection()->CloseConnection(quic_error, false);
diff --git a/net/socket/client_socket_pool_base.cc b/net/socket/client_socket_pool_base.cc
index 29de892..c4b624a 100644
--- a/net/socket/client_socket_pool_base.cc
+++ b/net/socket/client_socket_pool_base.cc
@@ -319,9 +319,8 @@ void ClientSocketPoolBaseHelper::RequestSockets(
num_sockets = max_sockets_per_group_;
}
- request.net_log().BeginEvent(
- NetLog::TYPE_SOCKET_POOL_CONNECTING_N_SOCKETS,
- NetLog::IntegerCallback("num_sockets", num_sockets));
+ request.net_log().BeginEvent(NetLog::TYPE_SOCKET_POOL_CONNECTING_N_SOCKETS,
+ NetLog::IntCallback("num_sockets", num_sockets));
Group* group = GetOrCreateGroup(group_name);
@@ -1013,8 +1012,8 @@ void ClientSocketPoolBaseHelper::HandOutSocket(
if (handle->is_reused()) {
net_log.AddEvent(
NetLog::TYPE_SOCKET_POOL_REUSED_AN_EXISTING_SOCKET,
- NetLog::IntegerCallback(
- "idle_ms", static_cast<int>(idle_time.InMilliseconds())));
+ NetLog::IntCallback("idle_ms",
+ static_cast<int>(idle_time.InMilliseconds())));
}
net_log.AddEvent(
diff --git a/net/socket/socks5_client_socket.cc b/net/socket/socks5_client_socket.cc
index 3c07cda9..0ddc4b4 100644
--- a/net/socket/socks5_client_socket.cc
+++ b/net/socket/socks5_client_socket.cc
@@ -347,12 +347,12 @@ int SOCKS5ClientSocket::DoGreetReadComplete(int result) {
// Got the greet data.
if (buffer_[0] != kSOCKS5Version) {
net_log_.AddEvent(NetLog::TYPE_SOCKS_UNEXPECTED_VERSION,
- NetLog::IntegerCallback("version", buffer_[0]));
+ NetLog::IntCallback("version", buffer_[0]));
return ERR_SOCKS_CONNECTION_FAILED;
}
if (buffer_[1] != 0x00) {
net_log_.AddEvent(NetLog::TYPE_SOCKS_UNEXPECTED_AUTH,
- NetLog::IntegerCallback("method", buffer_[1]));
+ NetLog::IntCallback("method", buffer_[1]));
return ERR_SOCKS_CONNECTION_FAILED;
}
@@ -455,12 +455,12 @@ int SOCKS5ClientSocket::DoHandshakeReadComplete(int result) {
if (bytes_received_ == kReadHeaderSize) {
if (buffer_[0] != kSOCKS5Version || buffer_[2] != kNullByte) {
net_log_.AddEvent(NetLog::TYPE_SOCKS_UNEXPECTED_VERSION,
- NetLog::IntegerCallback("version", buffer_[0]));
+ NetLog::IntCallback("version", buffer_[0]));
return ERR_SOCKS_CONNECTION_FAILED;
}
if (buffer_[1] != 0x00) {
net_log_.AddEvent(NetLog::TYPE_SOCKS_SERVER_ERROR,
- NetLog::IntegerCallback("error_code", buffer_[1]));
+ NetLog::IntCallback("error_code", buffer_[1]));
return ERR_SOCKS_CONNECTION_FAILED;
}
@@ -479,7 +479,7 @@ int SOCKS5ClientSocket::DoHandshakeReadComplete(int result) {
read_header_size += sizeof(struct in6_addr) - 1;
else {
net_log_.AddEvent(NetLog::TYPE_SOCKS_UNKNOWN_ADDRESS_TYPE,
- NetLog::IntegerCallback("address_type", buffer_[3]));
+ NetLog::IntCallback("address_type", buffer_[3]));
return ERR_SOCKS_CONNECTION_FAILED;
}
diff --git a/net/socket/ssl_client_socket_nss.cc b/net/socket/ssl_client_socket_nss.cc
index d08b70f..904a776 100644
--- a/net/socket/ssl_client_socket_nss.cc
+++ b/net/socket/ssl_client_socket_nss.cc
@@ -2335,11 +2335,10 @@ void SSLClientSocketNSS::Core::PostOrRunCallback(
}
void SSLClientSocketNSS::Core::AddCertProvidedEvent(int cert_count) {
- PostOrRunCallback(
- FROM_HERE,
- base::Bind(&AddLogEventWithCallback, weak_net_log_,
- NetLog::TYPE_SSL_CLIENT_CERT_PROVIDED,
- NetLog::IntegerCallback("cert_count", cert_count)));
+ PostOrRunCallback(FROM_HERE,
+ base::Bind(&AddLogEventWithCallback, weak_net_log_,
+ NetLog::TYPE_SSL_CLIENT_CERT_PROVIDED,
+ NetLog::IntCallback("cert_count", cert_count)));
}
void SSLClientSocketNSS::Core::SetChannelIDProvided() {
diff --git a/net/socket/ssl_client_socket_openssl.cc b/net/socket/ssl_client_socket_openssl.cc
index 812871d..96ddd10 100644
--- a/net/socket/ssl_client_socket_openssl.cc
+++ b/net/socket/ssl_client_socket_openssl.cc
@@ -1847,14 +1847,14 @@ int SSLClientSocketOpenSSL::ClientCertRequestCallback(SSL* ssl) {
int cert_count = 1 + sk_X509_num(chain.get());
net_log_.AddEvent(NetLog::TYPE_SSL_CLIENT_CERT_PROVIDED,
- NetLog::IntegerCallback("cert_count", cert_count));
+ NetLog::IntCallback("cert_count", cert_count));
return 1;
}
#endif // defined(OS_IOS)
// Send no client certificate.
net_log_.AddEvent(NetLog::TYPE_SSL_CLIENT_CERT_PROVIDED,
- NetLog::IntegerCallback("cert_count", 0));
+ NetLog::IntCallback("cert_count", 0));
return 1;
}
diff --git a/net/socket/tcp_socket_posix.cc b/net/socket/tcp_socket_posix.cc
index 9c0c6ef..e432894 100644
--- a/net/socket/tcp_socket_posix.cc
+++ b/net/socket/tcp_socket_posix.cc
@@ -539,7 +539,7 @@ int TCPSocketPosix::HandleConnectCompleted(int rv) const {
// Log the end of this attempt (and any OS error it threw).
if (rv != OK) {
net_log_.EndEvent(NetLog::TYPE_TCP_CONNECT_ATTEMPT,
- NetLog::IntegerCallback("os_error", errno));
+ NetLog::IntCallback("os_error", errno));
} else {
net_log_.EndEvent(NetLog::TYPE_TCP_CONNECT_ATTEMPT);
}
diff --git a/net/socket/tcp_socket_win.cc b/net/socket/tcp_socket_win.cc
index 07fdc9e..4fa0d55 100644
--- a/net/socket/tcp_socket_win.cc
+++ b/net/socket/tcp_socket_win.cc
@@ -845,7 +845,7 @@ void TCPSocketWin::DoConnectComplete(int result) {
connect_os_error_ = 0;
if (result != OK) {
net_log_.EndEvent(NetLog::TYPE_TCP_CONNECT_ATTEMPT,
- NetLog::IntegerCallback("os_error", os_error));
+ NetLog::IntCallback("os_error", os_error));
} else {
net_log_.EndEvent(NetLog::TYPE_TCP_CONNECT_ATTEMPT);
}
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc
index 224b9ab..6fa7a03 100644
--- a/net/spdy/spdy_session.cc
+++ b/net/spdy/spdy_session.cc
@@ -1173,7 +1173,7 @@ scoped_ptr<SpdyBuffer> SpdySession::CreateDataBuffer(SpdyStreamId stream_id,
QueueSendStalledStream(*stream);
net_log().AddEvent(
NetLog::TYPE_HTTP2_SESSION_STREAM_STALLED_BY_STREAM_SEND_WINDOW,
- NetLog::IntegerCallback("stream_id", stream_id));
+ NetLog::IntCallback("stream_id", stream_id));
return scoped_ptr<SpdyBuffer>();
}
@@ -1188,7 +1188,7 @@ scoped_ptr<SpdyBuffer> SpdySession::CreateDataBuffer(SpdyStreamId stream_id,
QueueSendStalledStream(*stream);
net_log().AddEvent(
NetLog::TYPE_HTTP2_SESSION_STREAM_STALLED_BY_SESSION_SEND_WINDOW,
- NetLog::IntegerCallback("stream_id", stream_id));
+ NetLog::IntCallback("stream_id", stream_id));
return scoped_ptr<SpdyBuffer>();
}
@@ -2859,7 +2859,7 @@ void SpdySession::HandleSetting(uint32 id, uint32 value) {
if (value > static_cast<uint32>(kint32max)) {
net_log().AddEvent(
NetLog::TYPE_HTTP2_SESSION_INITIAL_WINDOW_SIZE_OUT_OF_RANGE,
- NetLog::IntegerCallback("initial_window_size", value));
+ NetLog::IntCallback("initial_window_size", value));
return;
}
@@ -2870,7 +2870,7 @@ void SpdySession::HandleSetting(uint32 id, uint32 value) {
UpdateStreamsSendWindowSize(delta_window_size);
net_log().AddEvent(
NetLog::TYPE_HTTP2_SESSION_UPDATE_STREAMS_SEND_WINDOW_SIZE,
- NetLog::IntegerCallback("delta_window_size", delta_window_size));
+ NetLog::IntCallback("delta_window_size", delta_window_size));
break;
}
}
diff --git a/net/spdy/spdy_stream.cc b/net/spdy/spdy_stream.cc
index 18f5faf..637f6db 100644
--- a/net/spdy/spdy_stream.cc
+++ b/net/spdy/spdy_stream.cc
@@ -729,7 +729,7 @@ void SpdyStream::PossiblyResumeIfSendStalled() {
if (send_stalled_by_flow_control_ && !session_->IsSendStalled() &&
send_window_size_ > 0) {
net_log_.AddEvent(NetLog::TYPE_HTTP2_STREAM_FLOW_CONTROL_UNSTALLED,
- NetLog::IntegerCallback("stream_id", stream_id_));
+ NetLog::IntCallback("stream_id", stream_id_));
send_stalled_by_flow_control_ = false;
QueueNextDataFrame();
}
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
index ad399b9..cff804c 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -1005,7 +1005,7 @@ void URLRequest::SetPriority(RequestPriority priority) {
priority_ = priority;
if (job_.get()) {
net_log_.AddEvent(NetLog::TYPE_URL_REQUEST_SET_PRIORITY,
- NetLog::IntegerCallback("priority", priority_));
+ NetLog::IntCallback("priority", priority_));
job_->SetPriority(priority_);
}
}