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 |
166 private: | 169 private: |
167 enum SocketOptions { | 170 enum SocketOptions { |
168 SOCKET_OPTION_REUSE_ADDRESS = 1 << 0, | 171 SOCKET_OPTION_REUSE_ADDRESS = 1 << 0, |
169 SOCKET_OPTION_BROADCAST = 1 << 1, | 172 SOCKET_OPTION_BROADCAST = 1 << 1, |
170 SOCKET_OPTION_MULTICAST_LOOP = 1 << 2 | 173 SOCKET_OPTION_MULTICAST_LOOP = 1 << 2 |
171 }; | 174 }; |
172 | 175 |
173 class ReadWatcher : public base::MessageLoopForIO::Watcher { | 176 class ReadWatcher : public base::MessageLoopForIO::Watcher { |
174 public: | 177 public: |
175 explicit ReadWatcher(UDPSocketLibevent* socket) : socket_(socket) {} | 178 explicit ReadWatcher(UDPSocketLibevent* socket) : socket_(socket) {} |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 CompletionCallback write_callback_; | 291 CompletionCallback write_callback_; |
289 | 292 |
290 BoundNetLog net_log_; | 293 BoundNetLog net_log_; |
291 | 294 |
292 DISALLOW_COPY_AND_ASSIGN(UDPSocketLibevent); | 295 DISALLOW_COPY_AND_ASSIGN(UDPSocketLibevent); |
293 }; | 296 }; |
294 | 297 |
295 } // namespace net | 298 } // namespace net |
296 | 299 |
297 #endif // NET_UDP_UDP_SOCKET_LIBEVENT_H_ | 300 #endif // NET_UDP_UDP_SOCKET_LIBEVENT_H_ |
OLD | NEW |