Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(596)

Unified Diff: ppapi/thunk/ppb_udp_socket_private_thunk.cc

Issue 9212047: Add GetBoundAddress to PPB_UDPSocket_Private (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: add backward compatability to interface, fix other review comments Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ppapi/thunk/ppb_udp_socket_private_thunk.cc
diff --git a/ppapi/thunk/ppb_udp_socket_private_thunk.cc b/ppapi/thunk/ppb_udp_socket_private_thunk.cc
index 9ee8b9dc0f5cd16ef0228d0ed8849114dce01916..4851deac13dc477ee2a69a091aa7ea64a6301985 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) {
+ EnterResource<PPB_UDPSocket_Private_API> enter(udp_socket, true);
yzshen1 2012/02/06 18:12:50 Please be consistent with others, use EnterUDP.
mtilburg1 2012/02/07 12:48:53 Done.
+ 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,7 +82,7 @@ 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,
@@ -84,10 +92,25 @@ const PPB_UDPSocket_Private g_ppb_udp_socket_thunk = {
&Close
};
+const PPB_UDPSocket_Private_0_3 g_ppb_udp_socket_thunk_0_3 = {
+ &Create,
+ &IsUDPSocket,
+ &Bind,
+ &GetBoundAddress,
+ &RecvFrom,
+ &GetRecvFromAddress,
+ &SendTo,
+ &Close
+};
+
} // 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

Powered by Google App Engine
This is Rietveld 408576698