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

Unified Diff: net/udp/udp_socket_libevent.h

Issue 8200011: Add NetLog support to UDP sockets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: ??? Created 9 years, 2 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_data_transfer_param.cc ('k') | net/udp/udp_socket_libevent.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/udp/udp_socket_libevent.h
===================================================================
--- net/udp/udp_socket_libevent.h (revision 106059)
+++ net/udp/udp_socket_libevent.h (working copy)
@@ -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 @@
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 @@
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);
« no previous file with comments | « net/udp/udp_data_transfer_param.cc ('k') | net/udp/udp_socket_libevent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698