summaryrefslogtreecommitdiffstats
path: root/ppapi/thunk/ppb_udp_socket_private_thunk.cc
diff options
context:
space:
mode:
authoryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-21 23:37:12 +0000
committeryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-21 23:37:12 +0000
commit669b2839b2a307ab08bcbc217efdb8a9f146c7c1 (patch)
tree601f882f71731c441eecb5f8b97f6bd0b6e8e78b /ppapi/thunk/ppb_udp_socket_private_thunk.cc
parent6681478ec237fa2b66b122a98f8630cefab22abc (diff)
downloadchromium_src-669b2839b2a307ab08bcbc217efdb8a9f146c7c1.zip
chromium_src-669b2839b2a307ab08bcbc217efdb8a9f146c7c1.tar.gz
chromium_src-669b2839b2a307ab08bcbc217efdb8a9f146c7c1.tar.bz2
GetBoundAddress will return the address that Bind actually bound to. If there has not been a successful call to Bind, this method will return an error.
BUG=no bug TEST=udp tests Review URL: https://chromiumcodereview.appspot.com/9212047 Patch from Mike Tilburg <mtilburg@adobe.com>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122910 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/thunk/ppb_udp_socket_private_thunk.cc')
-rw-r--r--ppapi/thunk/ppb_udp_socket_private_thunk.cc27
1 files changed, 25 insertions, 2 deletions
diff --git a/ppapi/thunk/ppb_udp_socket_private_thunk.cc b/ppapi/thunk/ppb_udp_socket_private_thunk.cc
index 9ee8b9d..4f12a3f 100644
--- a/ppapi/thunk/ppb_udp_socket_private_thunk.cc
+++ b/ppapi/thunk/ppb_udp_socket_private_thunk.cc
@@ -38,6 +38,14 @@ int32_t Bind(PP_Resource udp_socket,
return enter.SetResult(enter.object()->Bind(addr, callback));
}
+PP_Bool GetBoundAddress(PP_Resource udp_socket,
+ PP_NetAddress_Private* addr) {
+ EnterUDP enter(udp_socket, true);
+ if (enter.failed())
+ return PP_FALSE;
+ return enter.object()->GetBoundAddress(addr);
+}
+
int32_t RecvFrom(PP_Resource udp_socket,
char* buffer,
int32_t num_bytes,
@@ -74,10 +82,21 @@ void Close(PP_Resource udp_socket) {
enter.object()->Close();
}
-const PPB_UDPSocket_Private g_ppb_udp_socket_thunk = {
+const PPB_UDPSocket_Private_0_2 g_ppb_udp_socket_thunk_0_2 = {
+ &Create,
+ &IsUDPSocket,
+ &Bind,
+ &RecvFrom,
+ &GetRecvFromAddress,
+ &SendTo,
+ &Close
+};
+
+const PPB_UDPSocket_Private_0_3 g_ppb_udp_socket_thunk_0_3 = {
&Create,
&IsUDPSocket,
&Bind,
+ &GetBoundAddress,
&RecvFrom,
&GetRecvFromAddress,
&SendTo,
@@ -87,7 +106,11 @@ const PPB_UDPSocket_Private g_ppb_udp_socket_thunk = {
} // namespace
const PPB_UDPSocket_Private_0_2* GetPPB_UDPSocket_Private_0_2_Thunk() {
- return &g_ppb_udp_socket_thunk;
+ return &g_ppb_udp_socket_thunk_0_2;
+}
+
+const PPB_UDPSocket_Private_0_3* GetPPB_UDPSocket_Private_0_3_Thunk() {
+ return &g_ppb_udp_socket_thunk_0_3;
}
} // namespace thunk