| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_BROWSER_RENDERER_HOST_PEPPER_TCP_SOCKET_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_TCP_SOCKET_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_TCP_SOCKET_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_TCP_SOCKET_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 } | 25 } |
| 26 | 26 |
| 27 // PepperTCPSocket is used by PepperMessageFilter to handle requests from | 27 // PepperTCPSocket is used by PepperMessageFilter to handle requests from |
| 28 // the Pepper TCP socket API (PPB_TCPSocket_Private). | 28 // the Pepper TCP socket API (PPB_TCPSocket_Private). |
| 29 class PepperTCPSocket { | 29 class PepperTCPSocket { |
| 30 public: | 30 public: |
| 31 PepperTCPSocket(PepperMessageFilter* manager, | 31 PepperTCPSocket(PepperMessageFilter* manager, |
| 32 int32 routing_id, | 32 int32 routing_id, |
| 33 uint32 plugin_dispatcher_id, | 33 uint32 plugin_dispatcher_id, |
| 34 uint32 socket_id); | 34 uint32 socket_id); |
| 35 |
| 36 // Used for creation already connected sockets. Takes ownership of |
| 37 // |socket|. |
| 38 PepperTCPSocket(PepperMessageFilter* manager, |
| 39 int32 routing_id, |
| 40 uint32 plugin_dispatcher_id, |
| 41 uint32 socket_id, |
| 42 net::StreamSocket* socket); |
| 35 ~PepperTCPSocket(); | 43 ~PepperTCPSocket(); |
| 36 | 44 |
| 37 int routing_id() { return routing_id_; } | 45 int routing_id() { return routing_id_; } |
| 38 | 46 |
| 39 void Connect(const std::string& host, uint16_t port); | 47 void Connect(const std::string& host, uint16_t port); |
| 40 void ConnectWithNetAddress(const PP_NetAddress_Private& net_addr); | 48 void ConnectWithNetAddress(const PP_NetAddress_Private& net_addr); |
| 41 void SSLHandshake(const std::string& server_name, uint16_t server_port); | 49 void SSLHandshake(const std::string& server_name, uint16_t server_port); |
| 42 void Read(int32 bytes_to_read); | 50 void Read(int32 bytes_to_read); |
| 43 void Write(const std::string& data); | 51 void Write(const std::string& data); |
| 44 | 52 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 96 |
| 89 scoped_ptr<net::StreamSocket> socket_; | 97 scoped_ptr<net::StreamSocket> socket_; |
| 90 | 98 |
| 91 scoped_refptr<net::IOBuffer> read_buffer_; | 99 scoped_refptr<net::IOBuffer> read_buffer_; |
| 92 scoped_refptr<net::IOBuffer> write_buffer_; | 100 scoped_refptr<net::IOBuffer> write_buffer_; |
| 93 | 101 |
| 94 DISALLOW_COPY_AND_ASSIGN(PepperTCPSocket); | 102 DISALLOW_COPY_AND_ASSIGN(PepperTCPSocket); |
| 95 }; | 103 }; |
| 96 | 104 |
| 97 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_TCP_SOCKET_H_ | 105 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_TCP_SOCKET_H_ |
| OLD | NEW |