| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/udp/udp_socket_posix.h" | 5 #include "net/udp/udp_socket_posix.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <net/if.h> | 9 #include <net/if.h> |
| 10 #include <netdb.h> | 10 #include <netdb.h> |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 socket_options_(SOCKET_OPTION_MULTICAST_LOOP), | 83 socket_options_(SOCKET_OPTION_MULTICAST_LOOP), |
| 84 multicast_interface_(0), | 84 multicast_interface_(0), |
| 85 multicast_time_to_live_(1), | 85 multicast_time_to_live_(1), |
| 86 bind_type_(bind_type), | 86 bind_type_(bind_type), |
| 87 rand_int_cb_(rand_int_cb), | 87 rand_int_cb_(rand_int_cb), |
| 88 read_watcher_(this), | 88 read_watcher_(this), |
| 89 write_watcher_(this), | 89 write_watcher_(this), |
| 90 read_buf_len_(0), | 90 read_buf_len_(0), |
| 91 recv_from_address_(NULL), | 91 recv_from_address_(NULL), |
| 92 write_buf_len_(0), | 92 write_buf_len_(0), |
| 93 net_log_(BoundNetLog::Make(net_log, NetLogSourceType::UDP_SOCKET)), | 93 net_log_(NetLogWithSource::Make(net_log, NetLogSourceType::UDP_SOCKET)), |
| 94 bound_network_(NetworkChangeNotifier::kInvalidNetworkHandle) { | 94 bound_network_(NetworkChangeNotifier::kInvalidNetworkHandle) { |
| 95 net_log_.BeginEvent(NetLogEventType::SOCKET_ALIVE, | 95 net_log_.BeginEvent(NetLogEventType::SOCKET_ALIVE, |
| 96 source.ToEventParametersCallback()); | 96 source.ToEventParametersCallback()); |
| 97 if (bind_type == DatagramSocket::RANDOM_BIND) | 97 if (bind_type == DatagramSocket::RANDOM_BIND) |
| 98 DCHECK(!rand_int_cb.is_null()); | 98 DCHECK(!rand_int_cb.is_null()); |
| 99 } | 99 } |
| 100 | 100 |
| 101 UDPSocketPosix::~UDPSocketPosix() { | 101 UDPSocketPosix::~UDPSocketPosix() { |
| 102 Close(); | 102 Close(); |
| 103 net_log_.EndEvent(NetLogEventType::SOCKET_ALIVE); | 103 net_log_.EndEvent(NetLogEventType::SOCKET_ALIVE); |
| (...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 873 return MapSystemError(errno); | 873 return MapSystemError(errno); |
| 874 | 874 |
| 875 return OK; | 875 return OK; |
| 876 } | 876 } |
| 877 | 877 |
| 878 void UDPSocketPosix::DetachFromThread() { | 878 void UDPSocketPosix::DetachFromThread() { |
| 879 base::NonThreadSafe::DetachFromThread(); | 879 base::NonThreadSafe::DetachFromThread(); |
| 880 } | 880 } |
| 881 | 881 |
| 882 } // namespace net | 882 } // namespace net |
| OLD | NEW |