| 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_SOCKETS_TCP_API_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_SOCKETS_TCP_SOCKETS_TCP_API_H_ |
| 6 #define EXTENSIONS_BROWSER_API_SOCKETS_TCP_SOCKETS_TCP_API_H_ | 6 #define EXTENSIONS_BROWSER_API_SOCKETS_TCP_SOCKETS_TCP_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.h" | 9 #include "extensions/common/api/sockets_tcp.h" |
| 10 | 10 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 DECLARE_EXTENSION_FUNCTION("sockets.tcp.setPaused", SOCKETS_TCP_SETPAUSED) | 79 DECLARE_EXTENSION_FUNCTION("sockets.tcp.setPaused", SOCKETS_TCP_SETPAUSED) |
| 80 | 80 |
| 81 SocketsTcpSetPausedFunction(); | 81 SocketsTcpSetPausedFunction(); |
| 82 | 82 |
| 83 protected: | 83 protected: |
| 84 ~SocketsTcpSetPausedFunction() override; | 84 ~SocketsTcpSetPausedFunction() override; |
| 85 | 85 |
| 86 // AsyncApiFunction | 86 // AsyncApiFunction |
| 87 bool Prepare() override; | 87 bool Prepare() override; |
| 88 void Work() override; | 88 void Work() override; |
| 89 void AsyncWorkStart() override; |
| 89 | 90 |
| 90 private: | 91 private: |
| 91 scoped_ptr<sockets_tcp::SetPaused::Params> params_; | 92 scoped_ptr<sockets_tcp::SetPaused::Params> params_; |
| 92 TCPSocketEventDispatcher* socket_event_dispatcher_; | 93 TCPSocketEventDispatcher* socket_event_dispatcher_; |
| 94 bool defer_completion_; |
| 93 }; | 95 }; |
| 94 | 96 |
| 95 class SocketsTcpSetKeepAliveFunction : public TCPSocketAsyncApiFunction { | 97 class SocketsTcpSetKeepAliveFunction : public TCPSocketAsyncApiFunction { |
| 96 public: | 98 public: |
| 97 DECLARE_EXTENSION_FUNCTION("sockets.tcp.setKeepAlive", | 99 DECLARE_EXTENSION_FUNCTION("sockets.tcp.setKeepAlive", |
| 98 SOCKETS_TCP_SETKEEPALIVE) | 100 SOCKETS_TCP_SETKEEPALIVE) |
| 99 | 101 |
| 100 SocketsTcpSetKeepAliveFunction(); | 102 SocketsTcpSetKeepAliveFunction(); |
| 101 | 103 |
| 102 protected: | 104 protected: |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 scoped_ptr<sockets_tcp::Secure::Params> params_; | 261 scoped_ptr<sockets_tcp::Secure::Params> params_; |
| 260 scoped_refptr<net::URLRequestContextGetter> url_request_getter_; | 262 scoped_refptr<net::URLRequestContextGetter> url_request_getter_; |
| 261 | 263 |
| 262 DISALLOW_COPY_AND_ASSIGN(SocketsTcpSecureFunction); | 264 DISALLOW_COPY_AND_ASSIGN(SocketsTcpSecureFunction); |
| 263 }; | 265 }; |
| 264 | 266 |
| 265 } // namespace api | 267 } // namespace api |
| 266 } // namespace extensions | 268 } // namespace extensions |
| 267 | 269 |
| 268 #endif // EXTENSIONS_BROWSER_API_SOCKETS_TCP_SOCKETS_TCP_API_H_ | 270 #endif // EXTENSIONS_BROWSER_API_SOCKETS_TCP_SOCKETS_TCP_API_H_ |
| OLD | NEW |