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_LIBEVENT_H_ | 5 #ifndef NET_SOCKET_SOCKET_LIBEVENT_H_ |
6 #define NET_SOCKET_SOCKET_LIBEVENT_H_ | 6 #define NET_SOCKET_SOCKET_LIBEVENT_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 void SetPeerAddress(const SockaddrStorage& address); | 74 void SetPeerAddress(const SockaddrStorage& address); |
75 // Returns true if peer address has been set regardless of socket state. | 75 // Returns true if peer address has been set regardless of socket state. |
76 bool HasPeerAddress() const; | 76 bool HasPeerAddress() const; |
77 | 77 |
78 void Close(); | 78 void Close(); |
79 | 79 |
80 SocketDescriptor socket_fd() const { return socket_fd_; } | 80 SocketDescriptor socket_fd() const { return socket_fd_; } |
81 | 81 |
82 private: | 82 private: |
83 // base::MessageLoopForIO::Watcher methods. | 83 // base::MessageLoopForIO::Watcher methods. |
84 virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE; | 84 virtual void OnFileCanReadWithoutBlocking(int fd) override; |
85 virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE; | 85 virtual void OnFileCanWriteWithoutBlocking(int fd) override; |
86 | 86 |
87 int DoAccept(scoped_ptr<SocketLibevent>* socket); | 87 int DoAccept(scoped_ptr<SocketLibevent>* socket); |
88 void AcceptCompleted(); | 88 void AcceptCompleted(); |
89 | 89 |
90 int DoConnect(); | 90 int DoConnect(); |
91 void ConnectCompleted(); | 91 void ConnectCompleted(); |
92 | 92 |
93 int DoRead(IOBuffer* buf, int buf_len); | 93 int DoRead(IOBuffer* buf, int buf_len); |
94 void ReadCompleted(); | 94 void ReadCompleted(); |
95 | 95 |
(...skipping 27 matching lines...) Expand all Loading... |
123 scoped_ptr<SockaddrStorage> peer_address_; | 123 scoped_ptr<SockaddrStorage> peer_address_; |
124 | 124 |
125 base::ThreadChecker thread_checker_; | 125 base::ThreadChecker thread_checker_; |
126 | 126 |
127 DISALLOW_COPY_AND_ASSIGN(SocketLibevent); | 127 DISALLOW_COPY_AND_ASSIGN(SocketLibevent); |
128 }; | 128 }; |
129 | 129 |
130 } // namespace net | 130 } // namespace net |
131 | 131 |
132 #endif // NET_SOCKET_SOCKET_LIBEVENT_H_ | 132 #endif // NET_SOCKET_SOCKET_LIBEVENT_H_ |
OLD | NEW |