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

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: fix build error after rebase 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..68d372f6c14f3c18bab660a9a018a4e6f11e3061 100644
--- a/ppapi/cpp/private/udp_socket_private.cc
+++ b/ppapi/cpp/private/udp_socket_private.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -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