diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-21 19:37:06 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-21 19:37:06 +0000 |
commit | 29ccf7260e61f373ba1bdaf2836b781c32a97a8e (patch) | |
tree | fad35629ee74d4bb37da8c1f8e73b2561a63ec44 /ppapi | |
parent | b2a566e6ed4dfe3c3afd17c9872c2762193152a4 (diff) | |
download | chromium_src-29ccf7260e61f373ba1bdaf2836b781c32a97a8e.zip chromium_src-29ccf7260e61f373ba1bdaf2836b781c32a97a8e.tar.gz chromium_src-29ccf7260e61f373ba1bdaf2836b781c32a97a8e.tar.bz2 |
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
Diffstat (limited to 'ppapi')
-rw-r--r-- | ppapi/cpp/private/flash_menu.cc | 2 | ||||
-rw-r--r-- | ppapi/cpp/private/flash_menu.h | 4 | ||||
-rw-r--r-- | ppapi/cpp/private/flash_net_connector.cc | 2 | ||||
-rw-r--r-- | ppapi/cpp/private/flash_net_connector.h | 4 | ||||
-rw-r--r-- | ppapi/cpp/private/flash_udp_socket.cc | 72 | ||||
-rw-r--r-- | ppapi/cpp/private/flash_udp_socket.h | 40 | ||||
-rw-r--r-- | ppapi/ppapi_cpp.gypi | 4 |
7 files changed, 4 insertions, 124 deletions
diff --git a/ppapi/cpp/private/flash_menu.cc b/ppapi/cpp/private/flash_menu.cc index 5b78eec..ce13f7a 100644 --- a/ppapi/cpp/private/flash_menu.cc +++ b/ppapi/cpp/private/flash_menu.cc @@ -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" diff --git a/ppapi/cpp/private/flash_menu.h b/ppapi/cpp/private/flash_menu.h index a5d4408..88f1e50 100644 --- a/ppapi/cpp/private/flash_menu.h +++ b/ppapi/cpp/private/flash_menu.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_ diff --git a/ppapi/cpp/private/flash_net_connector.cc b/ppapi/cpp/private/flash_net_connector.cc index faa6c9b3a..970740d 100644 --- a/ppapi/cpp/private/flash_net_connector.cc +++ b/ppapi/cpp/private/flash_net_connector.cc @@ -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" diff --git a/ppapi/cpp/private/flash_net_connector.h b/ppapi/cpp/private/flash_net_connector.h index b855250..2ab14aa 100644 --- a/ppapi/cpp/private/flash_net_connector.h +++ b/ppapi/cpp/private/flash_net_connector.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_ diff --git a/ppapi/cpp/private/flash_udp_socket.cc b/ppapi/cpp/private/flash_udp_socket.cc deleted file mode 100644 index 797f3ea..0000000 --- a/ppapi/cpp/private/flash_udp_socket.cc +++ /dev/null @@ -1,72 +0,0 @@ -// 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 - diff --git a/ppapi/cpp/private/flash_udp_socket.h b/ppapi/cpp/private/flash_udp_socket.h deleted file mode 100644 index b4b223e..0000000 --- a/ppapi/cpp/private/flash_udp_socket.h +++ /dev/null @@ -1,40 +0,0 @@ -// 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_ - diff --git a/ppapi/ppapi_cpp.gypi b/ppapi/ppapi_cpp.gypi index 2c27557..348c81f 100644 --- a/ppapi/ppapi_cpp.gypi +++ b/ppapi/ppapi_cpp.gypi @@ -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', |