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

Unified Diff: net/udp/udp_socket_win.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_socket_unittest.cc ('k') | net/udp/udp_socket_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/udp/udp_socket_win.h
===================================================================
--- net/udp/udp_socket_win.h (revision 106059)
+++ net/udp/udp_socket_win.h (working copy)
@@ -21,8 +21,6 @@
namespace net {
-class BoundNetLog;
-
class UDPSocketWin : public base::NonThreadSafe {
public:
UDPSocketWin(DatagramSocket::BindType bind_type,
@@ -136,9 +134,13 @@
void DoWriteCallback(int rv);
void DidCompleteRead();
void DidCompleteWrite();
- bool ProcessSuccessfulRead(int num_bytes, IPEndPoint* address);
- void ProcessSuccessfulWrite(int num_bytes);
+ // Handles stats and logging. |result| is the number of bytes transferred, on
+ // success, or the net error code on failure. LogRead retrieves the address
+ // from |recv_addr_storage_|, while LogWrite takes it as an optional argument.
+ void LogRead(int result, const char* bytes) 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);
@@ -150,12 +152,17 @@
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);
int DoBind(const IPEndPoint& address);
int RandomBind(const IPEndPoint& address);
+ // Attempts to convert the data in |recv_addr_storage_| and |recv_addr_len_|
+ // to an IPEndPoint and writes it to |address|. Returns true on success.
+ bool ReceiveAddressToIPEndpoint(IPEndPoint* address) const;
+
SOCKET socket_;
// How to do source port binding, used only when UDPSocket is part of
@@ -188,6 +195,10 @@
socklen_t recv_addr_len_;
IPEndPoint* recv_from_address_;
+ // Cached copy of the current address we're sending to, if any. Used for
+ // logging.
+ scoped_ptr<IPEndPoint> send_to_address_;
+
// The buffer used by InternalWrite() to retry Write requests
scoped_refptr<IOBuffer> write_iobuffer_;
« no previous file with comments | « net/udp/udp_socket_unittest.cc ('k') | net/udp/udp_socket_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698