| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SOCKET_SOCKET_POSIX_H_ | 5 #ifndef NET_SOCKET_SOCKET_POSIX_H_ |
| 6 #define NET_SOCKET_SOCKET_POSIX_H_ | 6 #define NET_SOCKET_SOCKET_POSIX_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
| 14 #include "base/threading/thread_checker.h" | 14 #include "base/threading/thread_checker.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/net_export.h" |
| 17 #include "net/socket/socket_descriptor.h" | 17 #include "net/socket/socket_descriptor.h" |
| 18 | 18 |
| 19 namespace net { | 19 namespace net { |
| 20 | 20 |
| 21 class IOBuffer; | 21 class IOBuffer; |
| 22 class IPEndPoint; | |
| 23 struct SockaddrStorage; | 22 struct SockaddrStorage; |
| 24 | 23 |
| 25 // Socket class to provide asynchronous read/write operations on top of the | 24 // Socket class to provide asynchronous read/write operations on top of the |
| 26 // posix socket api. It supports AF_INET, AF_INET6, and AF_UNIX addresses. | 25 // posix socket api. It supports AF_INET, AF_INET6, and AF_UNIX addresses. |
| 27 class NET_EXPORT_PRIVATE SocketPosix : public base::MessageLoopForIO::Watcher { | 26 class NET_EXPORT_PRIVATE SocketPosix : public base::MessageLoopForIO::Watcher { |
| 28 public: | 27 public: |
| 29 SocketPosix(); | 28 SocketPosix(); |
| 30 ~SocketPosix() override; | 29 ~SocketPosix() override; |
| 31 | 30 |
| 32 // Opens a socket and returns net::OK if |address_family| is AF_INET, AF_INET6 | 31 // Opens a socket and returns net::OK if |address_family| is AF_INET, AF_INET6 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 std::unique_ptr<SockaddrStorage> peer_address_; | 127 std::unique_ptr<SockaddrStorage> peer_address_; |
| 129 | 128 |
| 130 base::ThreadChecker thread_checker_; | 129 base::ThreadChecker thread_checker_; |
| 131 | 130 |
| 132 DISALLOW_COPY_AND_ASSIGN(SocketPosix); | 131 DISALLOW_COPY_AND_ASSIGN(SocketPosix); |
| 133 }; | 132 }; |
| 134 | 133 |
| 135 } // namespace net | 134 } // namespace net |
| 136 | 135 |
| 137 #endif // NET_SOCKET_SOCKET_POSIX_H_ | 136 #endif // NET_SOCKET_SOCKET_POSIX_H_ |
| OLD | NEW |