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

Unified Diff: ppapi/cpp/private/udp_socket_private.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/cpp/private/udp_socket_private.cc
diff --git a/ppapi/cpp/private/udp_socket_private.cc b/ppapi/cpp/private/udp_socket_private.cc
index 8bd49f2f3028b69ee956275dd02da28e4a2265a1..a37ea6ab84318070336d4ec205fde36c1ece652a 100644
--- a/ppapi/cpp/private/udp_socket_private.cc
+++ b/ppapi/cpp/private/udp_socket_private.cc
@@ -36,6 +36,15 @@ int32_t UDPSocketPrivate::Bind(const PP_NetAddress_Private* addr,
pp_resource(), addr, callback.pp_completion_callback());
}
+bool UDPSocketPrivate::GetBoundAddress(PP_NetAddress_Private* addr) {
+ if (!has_interface<PPB_UDPSocket_Private>())
+ return false;
+
+ PP_Bool result = get_interface<PPB_UDPSocket_Private>()->GetBoundAddress(
+ pp_resource(), addr);
+ return PP_ToBool(result);
+}
+
int32_t UDPSocketPrivate::RecvFrom(char* buffer,
int32_t num_bytes,
const CompletionCallback& callback) {
@@ -65,5 +74,10 @@ int32_t UDPSocketPrivate::SendTo(const char* buffer,
callback.pp_completion_callback());
}
+void UDPSocketPrivate::Close() {
+ if (!has_interface<PPB_UDPSocket_Private>())
+ return;
+ return get_interface<PPB_UDPSocket_Private>()->Close(pp_resource());
+}
} // namespace pp

Powered by Google App Engine
This is Rietveld 408576698