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 EXTENSIONS_BROWSER_API_SOCKETS_TCP_SERVER_SOCKETS_TCP_SERVER_API_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_SOCKETS_TCP_SERVER_SOCKETS_TCP_SERVER_API_H_ |
6 #define EXTENSIONS_BROWSER_API_SOCKETS_TCP_SERVER_SOCKETS_TCP_SERVER_API_H_ | 6 #define EXTENSIONS_BROWSER_API_SOCKETS_TCP_SERVER_SOCKETS_TCP_SERVER_API_H_ |
7 | 7 |
8 #include "extensions/browser/api/socket/socket_api.h" | 8 #include "extensions/browser/api/socket/socket_api.h" |
9 #include "extensions/common/api/sockets_tcp_server.h" | 9 #include "extensions/common/api/sockets_tcp_server.h" |
10 | 10 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 DECLARE_EXTENSION_FUNCTION("sockets.tcpServer.listen", | 87 DECLARE_EXTENSION_FUNCTION("sockets.tcpServer.listen", |
88 SOCKETS_TCP_SERVER_LISTEN) | 88 SOCKETS_TCP_SERVER_LISTEN) |
89 | 89 |
90 SocketsTcpServerListenFunction(); | 90 SocketsTcpServerListenFunction(); |
91 | 91 |
92 protected: | 92 protected: |
93 ~SocketsTcpServerListenFunction() override; | 93 ~SocketsTcpServerListenFunction() override; |
94 | 94 |
95 // AsyncApiFunction: | 95 // AsyncApiFunction: |
96 bool Prepare() override; | 96 bool Prepare() override; |
97 void Work() override; | 97 void AsyncWorkStart() override; |
98 | 98 |
99 private: | 99 private: |
100 scoped_ptr<sockets_tcp_server::Listen::Params> params_; | 100 scoped_ptr<sockets_tcp_server::Listen::Params> params_; |
101 TCPServerSocketEventDispatcher* socket_event_dispatcher_; | 101 TCPServerSocketEventDispatcher* socket_event_dispatcher_; |
102 }; | 102 }; |
103 | 103 |
104 class SocketsTcpServerDisconnectFunction | 104 class SocketsTcpServerDisconnectFunction |
105 : public TCPServerSocketAsyncApiFunction { | 105 : public TCPServerSocketAsyncApiFunction { |
106 public: | 106 public: |
107 DECLARE_EXTENSION_FUNCTION("sockets.tcpServer.disconnect", | 107 DECLARE_EXTENSION_FUNCTION("sockets.tcpServer.disconnect", |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 169 |
170 // AsyncApiFunction: | 170 // AsyncApiFunction: |
171 bool Prepare() override; | 171 bool Prepare() override; |
172 void Work() override; | 172 void Work() override; |
173 }; | 173 }; |
174 | 174 |
175 } // namespace core_api | 175 } // namespace core_api |
176 } // namespace extensions | 176 } // namespace extensions |
177 | 177 |
178 #endif // EXTENSIONS_BROWSER_API_SOCKETS_TCP_SERVER_SOCKETS_TCP_SERVER_API_H_ | 178 #endif // EXTENSIONS_BROWSER_API_SOCKETS_TCP_SERVER_SOCKETS_TCP_SERVER_API_H_ |
OLD | NEW |