From 967cb67b49133bf331c7faa5dc6e51ddf41bbe09 Mon Sep 17 00:00:00 2001 From: "ygorshenin@chromium.org" Date: Tue, 21 May 2013 08:15:41 +0000 Subject: Exposed PPB_TCPServerSocketPrivate::GetLocalAddress(). BUG=223006 NOTRY=true TEST=browser_tests:*TCPServerSocketPrivate* Review URL: https://chromiumcodereview.appspot.com/14172007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201250 0039d316-1c4b-4281-b951-d872f2087c98 --- .../thunk/interfaces_ppb_private_no_permissions.h | 3 +++ ppapi/thunk/ppb_tcp_server_socket_private_api.h | 1 + ppapi/thunk/ppb_tcp_server_socket_private_thunk.cc | 29 +++++++++++++++++++--- 3 files changed, 30 insertions(+), 3 deletions(-) (limited to 'ppapi/thunk') diff --git a/ppapi/thunk/interfaces_ppb_private_no_permissions.h b/ppapi/thunk/interfaces_ppb_private_no_permissions.h index 138ce9c..dca6289 100644 --- a/ppapi/thunk/interfaces_ppb_private_no_permissions.h +++ b/ppapi/thunk/interfaces_ppb_private_no_permissions.h @@ -19,6 +19,9 @@ PROXIED_IFACE(NoAPIName, PPB_HOSTRESOLVER_PRIVATE_INTERFACE_0_1, PROXIED_IFACE(PPB_TCPServerSocket_Private, PPB_TCPSERVERSOCKET_PRIVATE_INTERFACE_0_1, PPB_TCPServerSocket_Private_0_1) +PROXIED_IFACE(PPB_TCPServerSocket_Private, + PPB_TCPSERVERSOCKET_PRIVATE_INTERFACE_0_2, + PPB_TCPServerSocket_Private_0_2) PROXIED_IFACE(PPB_TCPSocket_Private, PPB_TCPSOCKET_PRIVATE_INTERFACE_0_3, PPB_TCPSocket_Private_0_3) PROXIED_IFACE(PPB_TCPSocket_Private, PPB_TCPSOCKET_PRIVATE_INTERFACE_0_4, diff --git a/ppapi/thunk/ppb_tcp_server_socket_private_api.h b/ppapi/thunk/ppb_tcp_server_socket_private_api.h index 8563bef..0ca23d1 100644 --- a/ppapi/thunk/ppb_tcp_server_socket_private_api.h +++ b/ppapi/thunk/ppb_tcp_server_socket_private_api.h @@ -24,6 +24,7 @@ public: scoped_refptr callback) = 0; virtual int32_t Accept(PP_Resource* tcp_socket, scoped_refptr callback) = 0; + virtual int32_t GetLocalAddress(PP_NetAddress_Private* addr) = 0; virtual void StopListening() = 0; }; diff --git a/ppapi/thunk/ppb_tcp_server_socket_private_thunk.cc b/ppapi/thunk/ppb_tcp_server_socket_private_thunk.cc index a9fcb14..bbfe16d 100644 --- a/ppapi/thunk/ppb_tcp_server_socket_private_thunk.cc +++ b/ppapi/thunk/ppb_tcp_server_socket_private_thunk.cc @@ -49,13 +49,21 @@ int32_t Accept(PP_Resource tcp_server_socket, return enter.SetResult(enter.object()->Accept(tcp_socket, enter.callback())); } +int32_t GetLocalAddress(PP_Resource tcp_server_socket, + PP_NetAddress_Private* addr) { + EnterTCPServer enter(tcp_server_socket, true); + if (enter.failed()) + return PP_ERROR_BADRESOURCE; + return enter.object()->GetLocalAddress(addr); +} + void StopListening(PP_Resource tcp_server_socket) { EnterTCPServer enter(tcp_server_socket, true); if (enter.succeeded()) enter.object()->StopListening(); } -const PPB_TCPServerSocket_Private g_ppb_tcp_server_socket_thunk = { +const PPB_TCPServerSocket_Private_0_1 g_ppb_tcp_server_socket_thunk_0_1 = { Create, IsTCPServerSocket, Listen, @@ -63,10 +71,25 @@ const PPB_TCPServerSocket_Private g_ppb_tcp_server_socket_thunk = { StopListening }; +const PPB_TCPServerSocket_Private_0_2 g_ppb_tcp_server_socket_thunk_0_2 = { + Create, + IsTCPServerSocket, + Listen, + Accept, + GetLocalAddress, + StopListening, +}; + } // namespace -const PPB_TCPServerSocket_Private* GetPPB_TCPServerSocket_Private_0_1_Thunk() { - return &g_ppb_tcp_server_socket_thunk; +const PPB_TCPServerSocket_Private_0_1* +GetPPB_TCPServerSocket_Private_0_1_Thunk() { + return &g_ppb_tcp_server_socket_thunk_0_1; +} + +const PPB_TCPServerSocket_Private_0_2* +GetPPB_TCPServerSocket_Private_0_2_Thunk() { + return &g_ppb_tcp_server_socket_thunk_0_2; } } // namespace thunk -- cgit v1.1