From 001c374c5356777641161bb11b8dd792508381ca Mon Sep 17 00:00:00 2001 From: eroman Date: Wed, 22 Apr 2015 20:11:17 -0700 Subject: Refactor NetLog::LogLevel --> NetLogCaptureMode. This is both a rename, and a functional change. Before LogLevel was an enum, and consumers would compare its numeric value, or use it for serialization purposes. Whereas NetLogCaptureMode is a class that encapsulates the various capabilities for a logging level. BUG=472710 TBR=asanka@chromium.org,sergeyu@chromium.org,yurys@chromium.org,bengr@chromium.org,asargent@chromium.org,zea@chromium.org,scherkus@chromium.org Review URL: https://codereview.chromium.org/1059843002 Cr-Commit-Position: refs/heads/master@{#326440} --- net/udp/udp_net_log_parameters.cc | 6 +++--- net/udp/udp_socket_libevent.cc | 4 ++-- net/udp/udp_socket_win.cc | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'net/udp') diff --git a/net/udp/udp_net_log_parameters.cc b/net/udp/udp_net_log_parameters.cc index c258823..fb25b4c 100644 --- a/net/udp/udp_net_log_parameters.cc +++ b/net/udp/udp_net_log_parameters.cc @@ -16,10 +16,10 @@ namespace { base::Value* NetLogUDPDataTranferCallback(int byte_count, const char* bytes, const IPEndPoint* address, - NetLog::LogLevel log_level) { + NetLogCaptureMode capture_mode) { base::DictionaryValue* dict = new base::DictionaryValue(); dict->SetInteger("byte_count", byte_count); - if (NetLog::IsLoggingBytes(log_level)) + if (capture_mode.include_socket_bytes()) dict->SetString("hex_encoded_bytes", base::HexEncode(bytes, byte_count)); if (address) dict->SetString("address", address->ToString()); @@ -27,7 +27,7 @@ base::Value* NetLogUDPDataTranferCallback(int byte_count, } base::Value* NetLogUDPConnectCallback(const IPEndPoint* address, - NetLog::LogLevel /* log_level */) { + NetLogCaptureMode /* capture_mode */) { base::DictionaryValue* dict = new base::DictionaryValue(); dict->SetString("address", address->ToString()); return dict; diff --git a/net/udp/udp_socket_libevent.cc b/net/udp/udp_socket_libevent.cc index 8259777..2fce83f 100644 --- a/net/udp/udp_socket_libevent.cc +++ b/net/udp/udp_socket_libevent.cc @@ -496,7 +496,7 @@ void UDPSocketLibevent::LogRead(int result, return; } - if (net_log_.IsLogging()) { + if (net_log_.GetCaptureMode().enabled()) { DCHECK(addr_len > 0); DCHECK(addr); @@ -533,7 +533,7 @@ void UDPSocketLibevent::LogWrite(int result, return; } - if (net_log_.IsLogging()) { + if (net_log_.GetCaptureMode().enabled()) { net_log_.AddEvent( NetLog::TYPE_UDP_BYTES_SENT, CreateNetLogUDPDataTranferCallback(result, bytes, address)); diff --git a/net/udp/udp_socket_win.cc b/net/udp/udp_socket_win.cc index b47247a..8c226f9 100644 --- a/net/udp/udp_socket_win.cc +++ b/net/udp/udp_socket_win.cc @@ -681,7 +681,7 @@ void UDPSocketWin::LogRead(int result, return; } - if (net_log_.IsLogging()) { + if (net_log_.GetCaptureMode().enabled()) { net_log_.AddEvent( NetLog::TYPE_UDP_BYTES_RECEIVED, CreateNetLogUDPDataTranferCallback(result, bytes, address)); @@ -698,7 +698,7 @@ void UDPSocketWin::LogWrite(int result, return; } - if (net_log_.IsLogging()) { + if (net_log_.GetCaptureMode().enabled()) { net_log_.AddEvent( NetLog::TYPE_UDP_BYTES_SENT, CreateNetLogUDPDataTranferCallback(result, bytes, address)); -- cgit v1.1