diff options
author | ygorshenin@chromium.org <ygorshenin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-21 08:15:41 +0000 |
---|---|---|
committer | ygorshenin@chromium.org <ygorshenin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-21 08:15:41 +0000 |
commit | 967cb67b49133bf331c7faa5dc6e51ddf41bbe09 (patch) | |
tree | 373d946038f39a437226581f2a7f65cea9b24b88 /ppapi/thunk | |
parent | f07ea163e034e5d5532a7cbae0580ae809299515 (diff) | |
download | chromium_src-967cb67b49133bf331c7faa5dc6e51ddf41bbe09.zip chromium_src-967cb67b49133bf331c7faa5dc6e51ddf41bbe09.tar.gz chromium_src-967cb67b49133bf331c7faa5dc6e51ddf41bbe09.tar.bz2 |
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
Diffstat (limited to 'ppapi/thunk')
-rw-r--r-- | ppapi/thunk/interfaces_ppb_private_no_permissions.h | 3 | ||||
-rw-r--r-- | ppapi/thunk/ppb_tcp_server_socket_private_api.h | 1 | ||||
-rw-r--r-- | ppapi/thunk/ppb_tcp_server_socket_private_thunk.cc | 29 |
3 files changed, 30 insertions, 3 deletions
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<TrackedCallback> callback) = 0; virtual int32_t Accept(PP_Resource* tcp_socket, scoped_refptr<TrackedCallback> 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 |