| OLD | NEW |
| 1 // Copyright (c) 2011 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 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| (...skipping 13 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 void Connect(const std::string& host, uint16_t port); | 45 void Connect(const std::string& host, uint16_t port); |
| 38 void ConnectWithNetAddress(const PP_NetAddress_Private& net_addr); | 46 void ConnectWithNetAddress(const PP_NetAddress_Private& net_addr); |
| 39 void SSLHandshake(const std::string& server_name, uint16_t server_port); | 47 void SSLHandshake(const std::string& server_name, uint16_t server_port); |
| 40 void Read(int32 bytes_to_read); | 48 void Read(int32 bytes_to_read); |
| 41 void Write(const std::string& data); | 49 void Write(const std::string& data); |
| 42 | 50 |
| 43 private: | 51 private: |
| 44 enum ConnectionState { | 52 enum ConnectionState { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 93 |
| 86 scoped_ptr<net::StreamSocket> socket_; | 94 scoped_ptr<net::StreamSocket> socket_; |
| 87 | 95 |
| 88 scoped_refptr<net::IOBuffer> read_buffer_; | 96 scoped_refptr<net::IOBuffer> read_buffer_; |
| 89 scoped_refptr<net::IOBuffer> write_buffer_; | 97 scoped_refptr<net::IOBuffer> write_buffer_; |
| 90 | 98 |
| 91 DISALLOW_COPY_AND_ASSIGN(PepperTCPSocket); | 99 DISALLOW_COPY_AND_ASSIGN(PepperTCPSocket); |
| 92 }; | 100 }; |
| 93 | 101 |
| 94 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_TCP_SOCKET_H_ | 102 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_TCP_SOCKET_H_ |
| OLD | NEW |