| 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_RENDERER_PEPPER_PPB_TCP_SERVER_SOCKET_PRIVATE_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PPB_TCP_SERVER_SOCKET_PRIVATE_IMPL_H_ |
| 6 #define CONTENT_RENDERER_PEPPER_PPB_TCP_SERVER_SOCKET_PRIVATE_IMPL_H_ | 6 #define CONTENT_RENDERER_PEPPER_PPB_TCP_SERVER_SOCKET_PRIVATE_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "content/public/renderer/render_view_observer.h" |
| 9 #include "ppapi/shared_impl/private/ppb_tcp_server_socket_shared.h" | 10 #include "ppapi/shared_impl/private/ppb_tcp_server_socket_shared.h" |
| 10 | 11 |
| 11 namespace content { | 12 namespace content { |
| 12 class PepperHelperImpl; | |
| 13 | 13 |
| 14 class PPB_TCPServerSocket_Private_Impl | 14 class PPB_TCPServerSocket_Private_Impl |
| 15 : public ::ppapi::PPB_TCPServerSocket_Shared { | 15 : public ::ppapi::PPB_TCPServerSocket_Shared, |
| 16 public RenderViewObserver { |
| 16 public: | 17 public: |
| 17 static PP_Resource CreateResource(PP_Instance instance); | 18 static PP_Resource CreateResource(PP_Instance instance); |
| 18 | 19 |
| 19 virtual void OnAcceptCompleted( | 20 virtual void OnAcceptCompleted( |
| 20 bool succeeded, | 21 bool succeeded, |
| 21 uint32 accepted_socket_id, | 22 uint32 accepted_socket_id, |
| 22 const PP_NetAddress_Private& local_addr, | 23 const PP_NetAddress_Private& local_addr, |
| 23 const PP_NetAddress_Private& remote_addr) OVERRIDE; | 24 const PP_NetAddress_Private& remote_addr) OVERRIDE; |
| 24 | 25 |
| 25 virtual void SendListen(const PP_NetAddress_Private& addr, | 26 virtual void SendListen(const PP_NetAddress_Private& addr, |
| 26 int32_t backlog) OVERRIDE; | 27 int32_t backlog) OVERRIDE; |
| 27 virtual void SendAccept() OVERRIDE; | 28 virtual void SendAccept() OVERRIDE; |
| 28 virtual void SendStopListening() OVERRIDE; | 29 virtual void SendStopListening() OVERRIDE; |
| 29 | 30 |
| 30 private: | 31 private: |
| 31 PPB_TCPServerSocket_Private_Impl(PP_Instance instance); | 32 PPB_TCPServerSocket_Private_Impl(PP_Instance instance, |
| 33 RenderView* render_view); |
| 32 virtual ~PPB_TCPServerSocket_Private_Impl(); | 34 virtual ~PPB_TCPServerSocket_Private_Impl(); |
| 33 | 35 |
| 34 PepperHelperImpl* GetHelper(); | 36 // RenderViewObserver implementation. |
| 37 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 38 |
| 39 void OnTCPServerSocketListenACK(uint32 plugin_dispatcher_id, |
| 40 PP_Resource socket_resource, |
| 41 uint32 socket_id, |
| 42 const PP_NetAddress_Private& local_addr, |
| 43 int32_t status); |
| 44 void OnTCPServerSocketAcceptACK(uint32 plugin_dispatcher_id, |
| 45 uint32 socket_id, |
| 46 uint32 accepted_socket_id, |
| 47 const PP_NetAddress_Private& local_addr, |
| 48 const PP_NetAddress_Private& remote_addr); |
| 49 |
| 50 int routing_id_; |
| 35 | 51 |
| 36 DISALLOW_COPY_AND_ASSIGN(PPB_TCPServerSocket_Private_Impl); | 52 DISALLOW_COPY_AND_ASSIGN(PPB_TCPServerSocket_Private_Impl); |
| 37 }; | 53 }; |
| 38 | 54 |
| 39 } // namespace content | 55 } // namespace content |
| 40 | 56 |
| 41 #endif // CONTENT_RENDERER_PEPPER_PPB_TCP_SERVER_SOCKET_PRIVATE_IMPL_H_ | 57 #endif // CONTENT_RENDERER_PEPPER_PPB_TCP_SERVER_SOCKET_PRIVATE_IMPL_H_ |
| OLD | NEW |