#ifndef PPAPI_PROXY_NET_ADDRESS_RESOURCE_H_
#define PPAPI_PROXY_NET_ADDRESS_RESOURCE_H_
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "ppapi/c/private/ppb_net_address_private.h"
#include "ppapi/proxy/plugin_resource.h"
#include "ppapi/proxy/ppapi_proxy_export.h"
#include "ppapi/thunk/ppb_net_address_api.h"
namespace ppapi {
namespace proxy {
class PPAPI_PROXY_EXPORT NetAddressResource : public PluginResource,
public thunk::PPB_NetAddress_API {
public:
NetAddressResource(Connection connection,
PP_Instance instance,
const PP_NetAddress_IPv4& ipv4_addr);
NetAddressResource(Connection connection,
PP_Instance instance,
const PP_NetAddress_IPv6& ipv6_addr);
NetAddressResource(Connection connection,
PP_Instance instance,
const PP_NetAddress_Private& private_addr);
virtual ~NetAddressResource();
virtual thunk::PPB_NetAddress_API* AsPPB_NetAddress_API() OVERRIDE;
virtual PP_NetAddress_Family GetFamily() OVERRIDE;
virtual PP_Var DescribeAsString(PP_Bool include_port) OVERRIDE;
virtual PP_Bool DescribeAsIPv4Address(
PP_NetAddress_IPv4* ipv4_addr) OVERRIDE;
virtual PP_Bool DescribeAsIPv6Address(
PP_NetAddress_IPv6* ipv6_addr) OVERRIDE;
virtual const PP_NetAddress_Private& GetNetAddressPrivate() OVERRIDE;
private:
PP_NetAddress_Private address_;
DISALLOW_COPY_AND_ASSIGN(NetAddressResource);
};
}
}
#endif