| 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 #ifndef NET_UDP_UDP_SOCKET_LIBEVENT_H_ | 5 #ifndef NET_UDP_UDP_SOCKET_LIBEVENT_H_ |
| 6 #define NET_UDP_UDP_SOCKET_LIBEVENT_H_ | 6 #define NET_UDP_UDP_SOCKET_LIBEVENT_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 // will not RECEIVE the loopback packets; while on Unix-like systems, the | 156 // will not RECEIVE the loopback packets; while on Unix-like systems, the |
| 157 // applications with loopback off will not SEND the loopback packets to | 157 // applications with loopback off will not SEND the loopback packets to |
| 158 // other applications on the same host. See MSDN: http://goo.gl/6vqbj | 158 // other applications on the same host. See MSDN: http://goo.gl/6vqbj |
| 159 int SetMulticastLoopbackMode(bool loopback); | 159 int SetMulticastLoopbackMode(bool loopback); |
| 160 | 160 |
| 161 // Set the differentiated services flags on outgoing packets. May not | 161 // Set the differentiated services flags on outgoing packets. May not |
| 162 // do anything on some platforms. | 162 // do anything on some platforms. |
| 163 // Return a network error code. | 163 // Return a network error code. |
| 164 int SetDiffServCodePoint(DiffServCodePoint dscp); | 164 int SetDiffServCodePoint(DiffServCodePoint dscp); |
| 165 | 165 |
| 166 // Resets the thread to be used for thread-safety checks. | |
| 167 void DetachFromThread(); | |
| 168 | |
| 169 private: | 166 private: |
| 170 enum SocketOptions { | 167 enum SocketOptions { |
| 171 SOCKET_OPTION_REUSE_ADDRESS = 1 << 0, | 168 SOCKET_OPTION_REUSE_ADDRESS = 1 << 0, |
| 172 SOCKET_OPTION_BROADCAST = 1 << 1, | 169 SOCKET_OPTION_BROADCAST = 1 << 1, |
| 173 SOCKET_OPTION_MULTICAST_LOOP = 1 << 2 | 170 SOCKET_OPTION_MULTICAST_LOOP = 1 << 2 |
| 174 }; | 171 }; |
| 175 | 172 |
| 176 class ReadWatcher : public base::MessageLoopForIO::Watcher { | 173 class ReadWatcher : public base::MessageLoopForIO::Watcher { |
| 177 public: | 174 public: |
| 178 explicit ReadWatcher(UDPSocketLibevent* socket) : socket_(socket) {} | 175 explicit ReadWatcher(UDPSocketLibevent* socket) : socket_(socket) {} |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 CompletionCallback write_callback_; | 288 CompletionCallback write_callback_; |
| 292 | 289 |
| 293 BoundNetLog net_log_; | 290 BoundNetLog net_log_; |
| 294 | 291 |
| 295 DISALLOW_COPY_AND_ASSIGN(UDPSocketLibevent); | 292 DISALLOW_COPY_AND_ASSIGN(UDPSocketLibevent); |
| 296 }; | 293 }; |
| 297 | 294 |
| 298 } // namespace net | 295 } // namespace net |
| 299 | 296 |
| 300 #endif // NET_UDP_UDP_SOCKET_LIBEVENT_H_ | 297 #endif // NET_UDP_UDP_SOCKET_LIBEVENT_H_ |
| OLD | NEW |