summaryrefslogtreecommitdiff
path: root/chromium/net/socket/socket_net_log_params.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/net/socket/socket_net_log_params.h')
-rw-r--r--chromium/net/socket/socket_net_log_params.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/chromium/net/socket/socket_net_log_params.h b/chromium/net/socket/socket_net_log_params.h
new file mode 100644
index 00000000000..f5fe652d125
--- /dev/null
+++ b/chromium/net/socket/socket_net_log_params.h
@@ -0,0 +1,38 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_SOCKET_SOCKET_NET_LOG_PARAMS_H_
+#define NET_SOCKET_SOCKET_NET_LOG_PARAMS_H_
+
+#include "net/base/net_log.h"
+#include "net/base/sys_addrinfo.h"
+
+namespace net {
+
+class HostPortPair;
+class IPEndPoint;
+
+// Creates a NetLog callback for socket error events.
+NetLog::ParametersCallback CreateNetLogSocketErrorCallback(int net_error,
+ int os_error);
+
+// 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);
+
+// 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_NET_LOG_PARAMS_H_