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_SOCKET_SOCKET_API_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_SOCKET_SOCKET_API_H_ |
6 #define EXTENSIONS_BROWSER_API_SOCKET_SOCKET_API_H_ | 6 #define EXTENSIONS_BROWSER_API_SOCKET_SOCKET_API_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 // SocketExtensionWithDnsLookupFunction: | 197 // SocketExtensionWithDnsLookupFunction: |
198 virtual void AfterDnsLookup(int lookup_result) OVERRIDE; | 198 virtual void AfterDnsLookup(int lookup_result) OVERRIDE; |
199 | 199 |
200 private: | 200 private: |
201 void StartConnect(); | 201 void StartConnect(); |
202 void OnConnect(int result); | 202 void OnConnect(int result); |
203 | 203 |
204 int socket_id_; | 204 int socket_id_; |
205 std::string hostname_; | 205 std::string hostname_; |
206 int port_; | 206 int port_; |
207 Socket* socket_; | |
208 }; | 207 }; |
209 | 208 |
210 class SocketDisconnectFunction : public SocketAsyncApiFunction { | 209 class SocketDisconnectFunction : public SocketAsyncApiFunction { |
211 public: | 210 public: |
212 DECLARE_EXTENSION_FUNCTION("socket.disconnect", SOCKET_DISCONNECT) | 211 DECLARE_EXTENSION_FUNCTION("socket.disconnect", SOCKET_DISCONNECT) |
213 | 212 |
214 protected: | 213 protected: |
215 virtual ~SocketDisconnectFunction() {} | 214 virtual ~SocketDisconnectFunction() {} |
216 | 215 |
217 // AsyncApiFunction: | 216 // AsyncApiFunction: |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 virtual void AfterDnsLookup(int lookup_result) OVERRIDE; | 351 virtual void AfterDnsLookup(int lookup_result) OVERRIDE; |
353 | 352 |
354 private: | 353 private: |
355 void StartSendTo(); | 354 void StartSendTo(); |
356 | 355 |
357 int socket_id_; | 356 int socket_id_; |
358 scoped_refptr<net::IOBuffer> io_buffer_; | 357 scoped_refptr<net::IOBuffer> io_buffer_; |
359 size_t io_buffer_size_; | 358 size_t io_buffer_size_; |
360 std::string hostname_; | 359 std::string hostname_; |
361 int port_; | 360 int port_; |
362 Socket* socket_; | |
363 }; | 361 }; |
364 | 362 |
365 class SocketSetKeepAliveFunction : public SocketAsyncApiFunction { | 363 class SocketSetKeepAliveFunction : public SocketAsyncApiFunction { |
366 public: | 364 public: |
367 DECLARE_EXTENSION_FUNCTION("socket.setKeepAlive", SOCKET_SETKEEPALIVE) | 365 DECLARE_EXTENSION_FUNCTION("socket.setKeepAlive", SOCKET_SETKEEPALIVE) |
368 | 366 |
369 SocketSetKeepAliveFunction(); | 367 SocketSetKeepAliveFunction(); |
370 | 368 |
371 protected: | 369 protected: |
372 virtual ~SocketSetKeepAliveFunction(); | 370 virtual ~SocketSetKeepAliveFunction(); |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 | 531 |
534 scoped_ptr<core_api::socket::Secure::Params> params_; | 532 scoped_ptr<core_api::socket::Secure::Params> params_; |
535 scoped_refptr<net::URLRequestContextGetter> url_request_getter_; | 533 scoped_refptr<net::URLRequestContextGetter> url_request_getter_; |
536 | 534 |
537 DISALLOW_COPY_AND_ASSIGN(SocketSecureFunction); | 535 DISALLOW_COPY_AND_ASSIGN(SocketSecureFunction); |
538 }; | 536 }; |
539 | 537 |
540 } // namespace extensions | 538 } // namespace extensions |
541 | 539 |
542 #endif // EXTENSIONS_BROWSER_API_SOCKET_SOCKET_API_H_ | 540 #endif // EXTENSIONS_BROWSER_API_SOCKET_SOCKET_API_H_ |
OLD | NEW |