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

Unified Diff: net/socket/socket_net_log_params.h

Issue 10546162: NetLogEventParameter to Callback refactoring 9. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Update comment Created 8 years, 6 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/socket/socket_net_log_params.h
===================================================================
--- net/socket/socket_net_log_params.h (revision 141995)
+++ net/socket/socket_net_log_params.h (working copy)
@@ -2,29 +2,38 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef NET_SOCKET_SOCKET_ERROR_PARAMS_H_
-#define NET_SOCKET_SOCKET_ERROR_PARAMS_H_
+#ifndef NET_SOCKET_SOCKET_NET_LOG_PARAMS_H_
+#define NET_SOCKET_SOCKET_NET_LOG_PARAMS_H_
#pragma once
#include "net/base/net_log.h"
+#include "net/base/net_util.h"
mmenke 2012/06/14 14:35:08 This is the simplest way to get sockaddr and sockl
eroman 2012/06/14 17:45:50 How about: #include "base/sys_addrinfo.h"
mmenke 2012/06/14 18:03:45 Done (With the corrected path)
eroman 2012/06/14 18:08:34 haha.... ooops.
namespace net {
-// Extra parameters to attach to the NetLog when we receive a socket error.
-class SocketErrorParams : public NetLog::EventParameters {
- public:
- SocketErrorParams(int net_error, int os_error);
+class HostPortPair;
+class IPEndPoint;
- virtual base::Value* ToValue() const OVERRIDE;
+// Creates a NetLog callback for socket error events.
+NetLog::ParametersCallback CreateNetLogSocketErrorCallback(int net_error,
+ int os_error);
- protected:
- virtual ~SocketErrorParams();
+// Creates a NetLog callback for a HostPortPair.
+// |host_and_port| must remain valid for the lifetime of the returned callback.
+NetLog::ParametersCallback CreateNetLogHostPortPairCallback(
+ const HostPortPair* host_and_port);
- private:
- const int net_error_;
- const int os_error_;
-};
+// Creates a NetLog callback for an IPEndPoint.
+// |address| must remain valid for the lifetime of the returned callback.
+NetLog::ParametersCallback CreateNetLogIPEndPointCallback(
+ const IPEndPoint* address);
+// Creates a NetLog callback for the source sockaddr on connect events.
+// |net_address| must remain valid for the lifetime of the returned callback.
+NetLog::ParametersCallback CreateNetLogSourceAddressCallback(
+ const struct sockaddr* net_address,
+ socklen_t address_len);
+
} // namespace net
-#endif // NET_SOCKET_SOCKET_ERROR_PARAMS_H_
+#endif // NET_SOCKET_SOCKET_NET_LOG_PARAMS_H_

Powered by Google App Engine
This is Rietveld 408576698