Pepper: Add remaining Flash-specific C++ Pepper wrappers to ppapi_cpp.gypi.

Also, remove flash_udp_socket.{cc,h}. They aren't actually used by Flapper right
now (and any new usage should use udp_socket_private.{cc,h}).

TEST=builds
TBR=dmichael@chromium.org

Review URL: http://codereview.chromium.org/8561033

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110981 0039d316-1c4b-4281-b951-d872f2087c98
parent b2a566e6
......@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// TODO(viettrungluu): See the comment in corresponding .h file.
#include "ppapi/cpp/private/flash_menu.h"
#include "ppapi/c/pp_errors.h"
......
......@@ -2,10 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// TODO(viettrungluu): This (and the .cc file) contain C++ wrappers for some
// things in ppapi/c/private/ppb_flash_menu.h. This is currently not used in (or
// even compiled with) Chromium.
#ifndef PPAPI_CPP_PRIVATE_FLASH_MENU_H_
#define PPAPI_CPP_PRIVATE_FLASH_MENU_H_
......
......@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// TODO(viettrungluu): See the comment in corresponding .h file.
#include "ppapi/cpp/private/flash_net_connector.h"
#include "ppapi/c/pp_errors.h"
......
......@@ -2,10 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// TODO(viettrungluu): This (and the .cc file) contain C++ wrappers for things
// in ppapi/c/private/ppb_flash_net_connector.h. This is currently not used in
// (or even compiled with) Chromium.
#ifndef PPAPI_CPP_PRIVATE_FLASH_NET_CONNECTOR_H_
#define PPAPI_CPP_PRIVATE_FLASH_NET_CONNECTOR_H_
......
// Copyright (c) 2011 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.
#include "ppapi/cpp/private/flash_udp_socket.h"
#include "ppapi/c/pp_bool.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/cpp/completion_callback.h"
#include "ppapi/cpp/instance.h"
#include "ppapi/cpp/module.h"
#include "ppapi/cpp/module_impl.h"
namespace pp {
namespace {
template <> const char* interface_name<PPB_Flash_UDPSocket>() {
return PPB_FLASH_UDPSOCKET_INTERFACE;
}
} // namespace
namespace flash {
UDPSocket::UDPSocket(Instance* instance) {
if (has_interface<PPB_Flash_UDPSocket>() && instance) {
PassRefFromConstructor(get_interface<PPB_Flash_UDPSocket>()->Create(
instance->pp_instance()));
}
}
int32_t UDPSocket::Bind(const PP_NetAddress_Private* addr,
const CompletionCallback& callback) {
if (!has_interface<PPB_Flash_UDPSocket>())
return PP_ERROR_NOINTERFACE;
return get_interface<PPB_Flash_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>())
return PP_ERROR_NOINTERFACE;
return get_interface<PPB_Flash_UDPSocket>()->RecvFrom(
pp_resource(), buffer, num_bytes, callback.pp_completion_callback());
}
bool UDPSocket::GetRecvFromAddress(PP_NetAddress_Private* addr) {
if (!has_interface<PPB_Flash_UDPSocket>())
return false;
PP_Bool result = get_interface<PPB_Flash_UDPSocket>()->GetRecvFromAddress(
pp_resource(), addr);
return PP_ToBool(result);
}
int32_t UDPSocket::SendTo(const char* buffer,
int32_t num_bytes,
const PP_NetAddress_Private* addr,
const CompletionCallback& callback) {
if (!has_interface<PPB_Flash_UDPSocket>())
return PP_ERROR_NOINTERFACE;
return get_interface<PPB_Flash_UDPSocket>()->SendTo(
pp_resource(), buffer, num_bytes, addr,
callback.pp_completion_callback());
}
} // namespace flash
} // namespace pp
// Copyright (c) 2011 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.
#ifndef PPAPI_CPP_PRIVATE_FLASH_UDP_SOCKET_H_
#define PPAPI_CPP_PRIVATE_FLASH_UDP_SOCKET_H_
#include "ppapi/c/pp_stdint.h"
#include "ppapi/c/private/ppb_flash_udp_socket.h"
#include "ppapi/cpp/resource.h"
namespace pp {
class CompletionCallback;
class Instance;
namespace flash {
class UDPSocket : public Resource {
public:
explicit UDPSocket(Instance* instance);
int32_t Bind(const PP_NetAddress_Private* addr,
const CompletionCallback& callback);
int32_t RecvFrom(char* buffer,
int32_t num_bytes,
const CompletionCallback& callback);
bool GetRecvFromAddress(PP_NetAddress_Private* addr);
int32_t SendTo(const char* buffer,
int32_t num_bytes,
const PP_NetAddress_Private* addr,
const CompletionCallback& callback);
void Close();
};
} // namespace flash
} // namespace pp
#endif // PPAPI_CPP_PRIVATE_FLASH_UDP_SOCKET_H_
......@@ -254,6 +254,10 @@
# Private interfaces.
'cpp/private/flash_fullscreen.cc',
'cpp/private/flash_fullscreen.h',
'cpp/private/flash_menu.cc',
'cpp/private/flash_menu.h',
'cpp/private/flash_net_connector.cc',
'cpp/private/flash_net_connector.h',
'cpp/private/instance_private.cc',
'cpp/private/instance_private.h',
'cpp/private/net_address_private.cc',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment