Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_WIN_H_ | 5 #ifndef NET_UDP_UDP_SOCKET_WIN_H_ |
| 6 #define NET_UDP_UDP_SOCKET_WIN_H_ | 6 #define NET_UDP_UDP_SOCKET_WIN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <winsock2.h> | 9 #include <winsock2.h> |
| 10 | 10 |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/threading/non_thread_safe.h" | 13 #include "base/threading/non_thread_safe.h" |
| 14 #include "base/win/object_watcher.h" | 14 #include "base/win/object_watcher.h" |
| 15 #include "net/base/completion_callback.h" | 15 #include "net/base/completion_callback.h" |
| 16 #include "net/base/net_export.h" | |
| 16 #include "net/base/rand_callback.h" | 17 #include "net/base/rand_callback.h" |
| 17 #include "net/base/ip_endpoint.h" | 18 #include "net/base/ip_endpoint.h" |
| 18 #include "net/base/io_buffer.h" | 19 #include "net/base/io_buffer.h" |
| 19 #include "net/base/net_log.h" | 20 #include "net/base/net_log.h" |
| 20 #include "net/udp/datagram_socket.h" | 21 #include "net/udp/datagram_socket.h" |
| 21 | 22 |
| 22 namespace net { | 23 namespace net { |
| 23 | 24 |
| 24 class UDPSocketWin : public base::NonThreadSafe { | 25 // Disable warning non dll-interface class used as base for dll-interface class. |
| 26 #pragma warning (push) | |
| 27 #pragma warning (disable:4275) | |
| 28 class NET_EXPORT UDPSocketWin : public base::NonThreadSafe { | |
|
agl
2012/04/23 21:07:08
See NON_EXPORTED_BASE macro for this.
Peng
2012/04/24 15:07:14
Done.
| |
| 25 public: | 29 public: |
| 26 UDPSocketWin(DatagramSocket::BindType bind_type, | 30 UDPSocketWin(DatagramSocket::BindType bind_type, |
| 27 const RandIntCallback& rand_int_cb, | 31 const RandIntCallback& rand_int_cb, |
| 28 net::NetLog* net_log, | 32 net::NetLog* net_log, |
| 29 const net::NetLog::Source& source); | 33 const net::NetLog::Source& source); |
| 30 virtual ~UDPSocketWin(); | 34 virtual ~UDPSocketWin(); |
| 31 | 35 |
| 32 // Connect the socket to connect with a certain |address|. | 36 // Connect the socket to connect with a certain |address|. |
| 33 // Returns a net error code. | 37 // Returns a net error code. |
| 34 int Connect(const IPEndPoint& address); | 38 int Connect(const IPEndPoint& address); |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 205 // External callback; called when read is complete. | 209 // External callback; called when read is complete. |
| 206 CompletionCallback read_callback_; | 210 CompletionCallback read_callback_; |
| 207 | 211 |
| 208 // External callback; called when write is complete. | 212 // External callback; called when write is complete. |
| 209 CompletionCallback write_callback_; | 213 CompletionCallback write_callback_; |
| 210 | 214 |
| 211 BoundNetLog net_log_; | 215 BoundNetLog net_log_; |
| 212 | 216 |
| 213 DISALLOW_COPY_AND_ASSIGN(UDPSocketWin); | 217 DISALLOW_COPY_AND_ASSIGN(UDPSocketWin); |
| 214 }; | 218 }; |
| 219 #pragma warning (pop) | |
| 215 | 220 |
| 216 } // namespace net | 221 } // namespace net |
| 217 | 222 |
| 218 #endif // NET_UDP_UDP_SOCKET_WIN_H_ | 223 #endif // NET_UDP_UDP_SOCKET_WIN_H_ |
| OLD | NEW |