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

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: Fix linux yet again 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
Index: net/udp/udp_socket_libevent.h
===================================================================
--- net/udp/udp_socket_libevent.h (revision 105801)
+++ 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,
@@ -145,6 +144,19 @@
void DidCompleteRead();
void DidCompleteWrite();
+ // Handles stats and logging. |result| is the number of bytes sent, on
+ // success, or the net error code on failure. If |result| indicates success,
+ // |addr_len| and |addr| must identify the socket we're receiving from.
+ // On success, if |address| is also non-NULL, populates it with the
+ // information in |addr|. Returns final status code, which is just |result|,
+ // unless unable to convert |addr| to an IPEndPoint and |address| is non-NULL.
+ int LogRead(int result, const char* bytes, socklen_t addr_len,
+ const sockaddr* addr, IPEndPoint* address) const;
+ // Handles stats and logging. Values are the same as in LogRead, except
+ // |address| will not be modified. Returns |result|.
+ int LogWrite(int result, const char* bytes,
+ const IPEndPoint* address) const;
+
// Returns the OS error code (or 0 on success).
int CreateSocket(const IPEndPoint& address);
@@ -156,6 +168,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);

Powered by Google App Engine
This is Rietveld 408576698