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

Unified Diff: net/udp/udp_socket_win.cc

Issue 2315613002: Extracted NetLog class's inner enum types into their own enum classes and (Closed)
Patch Set: Ran "git cl format" on code. Much formatting ensued. Created 4 years, 3 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/udp/udp_socket_unittest.cc ('k') | net/url_request/sdch_dictionary_fetcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/udp/udp_socket_win.cc
diff --git a/net/udp/udp_socket_win.cc b/net/udp/udp_socket_win.cc
index b8c3b5831a346be6cbdf0587b4604ce389676f2f..5b4ae145d37f9f9817f2786e81933f2556771c4c 100644
--- a/net/udp/udp_socket_win.cc
+++ b/net/udp/udp_socket_win.cc
@@ -24,6 +24,8 @@
#include "net/base/winsock_init.h"
#include "net/base/winsock_util.h"
#include "net/log/net_log.h"
+#include "net/log/net_log_event_type.h"
+#include "net/log/net_log_source_type.h"
#include "net/socket/socket_descriptor.h"
#include "net/udp/udp_net_log_parameters.h"
@@ -255,11 +257,11 @@ UDPSocketWin::UDPSocketWin(DatagramSocket::BindType bind_type,
read_iobuffer_len_(0),
write_iobuffer_len_(0),
recv_from_address_(NULL),
- net_log_(BoundNetLog::Make(net_log, NetLog::SOURCE_UDP_SOCKET)),
+ net_log_(BoundNetLog::Make(net_log, NetLogSourceType::UDP_SOCKET)),
qos_handle_(NULL),
qos_flow_id_(0) {
EnsureWinsockInit();
- net_log_.BeginEvent(NetLog::TYPE_SOCKET_ALIVE,
+ net_log_.BeginEvent(NetLogEventType::SOCKET_ALIVE,
source.ToEventParametersCallback());
if (bind_type == DatagramSocket::RANDOM_BIND)
DCHECK(!rand_int_cb.is_null());
@@ -267,7 +269,7 @@ UDPSocketWin::UDPSocketWin(DatagramSocket::BindType bind_type,
UDPSocketWin::~UDPSocketWin() {
Close();
- net_log_.EndEvent(NetLog::TYPE_SOCKET_ALIVE);
+ net_log_.EndEvent(NetLogEventType::SOCKET_ALIVE);
}
int UDPSocketWin::Open(AddressFamily address_family) {
@@ -355,7 +357,7 @@ int UDPSocketWin::GetLocalAddress(IPEndPoint* address) const {
if (!local_address->FromSockAddr(storage.addr, storage.addr_len))
return ERR_ADDRESS_INVALID;
local_address_.reset(local_address.release());
- net_log_.AddEvent(NetLog::TYPE_UDP_LOCAL_ADDRESS,
+ net_log_.AddEvent(NetLogEventType::UDP_LOCAL_ADDRESS,
CreateNetLogUDPConnectCallback(
local_address_.get(),
NetworkChangeNotifier::kInvalidNetworkHandle));
@@ -430,11 +432,11 @@ int UDPSocketWin::SendToOrWrite(IOBuffer* buf,
int UDPSocketWin::Connect(const IPEndPoint& address) {
DCHECK_NE(socket_, INVALID_SOCKET);
net_log_.BeginEvent(
- NetLog::TYPE_UDP_CONNECT,
+ NetLogEventType::UDP_CONNECT,
CreateNetLogUDPConnectCallback(
&address, NetworkChangeNotifier::kInvalidNetworkHandle));
int rv = InternalConnect(address);
- net_log_.EndEventWithNetErrorCode(NetLog::TYPE_UDP_CONNECT, rv);
+ net_log_.EndEventWithNetErrorCode(NetLogEventType::UDP_CONNECT, rv);
is_connected_ = (rv == OK);
return rv;
}
@@ -701,13 +703,14 @@ void UDPSocketWin::LogRead(int result,
const char* bytes,
const IPEndPoint* address) const {
if (result < 0) {
- net_log_.AddEventWithNetErrorCode(NetLog::TYPE_UDP_RECEIVE_ERROR, result);
+ net_log_.AddEventWithNetErrorCode(NetLogEventType::UDP_RECEIVE_ERROR,
+ result);
return;
}
if (net_log_.IsCapturing()) {
net_log_.AddEvent(
- NetLog::TYPE_UDP_BYTES_RECEIVED,
+ NetLogEventType::UDP_BYTES_RECEIVED,
CreateNetLogUDPDataTranferCallback(result, bytes, address));
}
@@ -718,13 +721,13 @@ void UDPSocketWin::LogWrite(int result,
const char* bytes,
const IPEndPoint* address) const {
if (result < 0) {
- net_log_.AddEventWithNetErrorCode(NetLog::TYPE_UDP_SEND_ERROR, result);
+ net_log_.AddEventWithNetErrorCode(NetLogEventType::UDP_SEND_ERROR, result);
return;
}
if (net_log_.IsCapturing()) {
net_log_.AddEvent(
- NetLog::TYPE_UDP_BYTES_SENT,
+ NetLogEventType::UDP_BYTES_SENT,
CreateNetLogUDPDataTranferCallback(result, bytes, address));
}
« no previous file with comments | « net/udp/udp_socket_unittest.cc ('k') | net/url_request/sdch_dictionary_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698