| Index: ppapi/cpp/private/udp_socket.cc
|
| diff --git a/ppapi/cpp/private/flash_udp_socket.cc b/ppapi/cpp/private/udp_socket.cc
|
| similarity index 58%
|
| rename from ppapi/cpp/private/flash_udp_socket.cc
|
| rename to ppapi/cpp/private/udp_socket.cc
|
| index 1ac36a37bb6e88175fdd3c49b04d2990090a8e45..4b1c145caf51fec7308ca46fe19142e97dbd9b2f 100644
|
| --- a/ppapi/cpp/private/flash_udp_socket.cc
|
| +++ b/ppapi/cpp/private/udp_socket.cc
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "ppapi/cpp/private/flash_udp_socket.h"
|
| +#include "ppapi/cpp/private/udp_socket.h"
|
|
|
| #include "ppapi/c/pp_bool.h"
|
| #include "ppapi/c/pp_errors.h"
|
| @@ -15,58 +15,55 @@ namespace pp {
|
|
|
| namespace {
|
|
|
| -template <> const char* interface_name<PPB_Flash_UDPSocket>() {
|
| - return PPB_FLASH_UDPSOCKET_INTERFACE;
|
| +template <> const char* interface_name<PPB_UDPSocket>() {
|
| + return PPB_UDPSOCKET_INTERFACE;
|
| }
|
|
|
| } // namespace
|
|
|
| -namespace flash {
|
| -
|
| UDPSocket::UDPSocket(Instance* instance) {
|
| - if (has_interface<PPB_Flash_UDPSocket>() && instance) {
|
| - PassRefFromConstructor(get_interface<PPB_Flash_UDPSocket>()->Create(
|
| + if (has_interface<PPB_UDPSocket>() && instance) {
|
| + PassRefFromConstructor(get_interface<PPB_UDPSocket>()->Create(
|
| instance->pp_instance()));
|
| }
|
| }
|
|
|
| -int32_t UDPSocket::Bind(const PP_Flash_NetAddress* addr,
|
| +int32_t UDPSocket::Bind(const PP_NetAddress* addr,
|
| const CompletionCallback& callback) {
|
| - if (!has_interface<PPB_Flash_UDPSocket>())
|
| + if (!has_interface<PPB_UDPSocket>())
|
| return PP_ERROR_NOINTERFACE;
|
| - return get_interface<PPB_Flash_UDPSocket>()->Bind(
|
| + return get_interface<PPB_UDPSocket>()->Bind(
|
| pp_resource(), addr, callback.pp_completion_callback());
|
| }
|
|
|
| int32_t UDPSocket::RecvFrom(char* buffer,
|
| int32_t num_bytes,
|
| const CompletionCallback& callback) {
|
| - if (!has_interface<PPB_Flash_UDPSocket>())
|
| + if (!has_interface<PPB_UDPSocket>())
|
| return PP_ERROR_NOINTERFACE;
|
| - return get_interface<PPB_Flash_UDPSocket>()->RecvFrom(
|
| + return get_interface<PPB_UDPSocket>()->RecvFrom(
|
| pp_resource(), buffer, num_bytes, callback.pp_completion_callback());
|
| }
|
|
|
| -bool UDPSocket::GetRecvFromAddress(PP_Flash_NetAddress* addr) {
|
| - if (!has_interface<PPB_Flash_UDPSocket>())
|
| +bool UDPSocket::GetRecvFromAddress(PP_NetAddress* addr) {
|
| + if (!has_interface<PPB_UDPSocket>())
|
| return false;
|
|
|
| - PP_Bool result = get_interface<PPB_Flash_UDPSocket>()->GetRecvFromAddress(
|
| + PP_Bool result = get_interface<PPB_UDPSocket>()->GetRecvFromAddress(
|
| pp_resource(), addr);
|
| return PP_ToBool(result);
|
| }
|
|
|
| int32_t UDPSocket::SendTo(const char* buffer,
|
| int32_t num_bytes,
|
| - const struct PP_Flash_NetAddress* addr,
|
| + const struct PP_NetAddress* addr,
|
| const CompletionCallback& callback) {
|
| - if (!has_interface<PPB_Flash_UDPSocket>())
|
| + if (!has_interface<PPB_UDPSocket>())
|
| return PP_ERROR_NOINTERFACE;
|
| - return get_interface<PPB_Flash_UDPSocket>()->SendTo(
|
| + return get_interface<PPB_UDPSocket>()->SendTo(
|
| pp_resource(), buffer, num_bytes, addr,
|
| callback.pp_completion_callback());
|
| }
|
|
|
| -} // namespace flash
|
| } // namespace pp
|
|
|
|
|