summaryrefslogtreecommitdiffstats
path: root/net/udp/udp_socket_libevent.h
diff options
context:
space:
mode:
authormmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-18 20:08:10 +0000
committermmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-18 20:08:10 +0000
commit8866f623dfd914c9f4c26ab96f90aecf4a372ef9 (patch)
tree4f45fa083309b6934e1888c27c9df2344cd391f0 /net/udp/udp_socket_libevent.h
parentdef979a39bd25dfb24c80138699ffb359c495757 (diff)
downloadchromium_src-8866f623dfd914c9f4c26ab96f90aecf4a372ef9.zip
chromium_src-8866f623dfd914c9f4c26ab96f90aecf4a372ef9.tar.gz
chromium_src-8866f623dfd914c9f4c26ab96f90aecf4a372ef9.tar.bz2
Add NetLog support to UDP sockets.
BUG=99508 TEST=UDPSocketTest.Connect Review URL: http://codereview.chromium.org/8200011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106109 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/udp/udp_socket_libevent.h')
-rw-r--r--net/udp/udp_socket_libevent.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/net/udp/udp_socket_libevent.h b/net/udp/udp_socket_libevent.h
index 6bdf4d4..abc2dd5 100644
--- a/net/udp/udp_socket_libevent.h
+++ b/net/udp/udp_socket_libevent.h
@@ -10,6 +10,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
#include "base/threading/non_thread_safe.h"
+#include "net/base/address_list_net_log_param.h"
#include "net/base/completion_callback.h"
#include "net/base/rand_callback.h"
#include "net/base/io_buffer.h"
@@ -19,8 +20,6 @@
namespace net {
-class BoundNetLog;
-
class UDPSocketLibevent : public base::NonThreadSafe {
public:
UDPSocketLibevent(DatagramSocket::BindType bind_type,
@@ -151,6 +150,14 @@ class UDPSocketLibevent : public base::NonThreadSafe {
void DidCompleteRead();
void DidCompleteWrite();
+ // Handles stats and logging. |result| is the number of bytes transferred, on
+ // success, or the net error code on failure. On success, LogRead takes in a
+ // sockaddr and its length, which are mandatory, while LogWrite takes in an
+ // optional IPEndPoint.
+ void LogRead(int result, const char* bytes, socklen_t addr_len,
+ const sockaddr* addr) const;
+ void LogWrite(int result, const char* bytes, const IPEndPoint* address) const;
+
// Returns the OS error code (or 0 on success).
int CreateSocket(const IPEndPoint& address);
@@ -162,6 +169,7 @@ class UDPSocketLibevent : public base::NonThreadSafe {
const IPEndPoint* address,
OldCompletionCallback* callback);
+ int InternalConnect(const IPEndPoint& address);
int InternalRecvFrom(IOBuffer* buf, int buf_len, IPEndPoint* address);
int InternalSendTo(IOBuffer* buf, int buf_len, const IPEndPoint* address);