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

Unified Diff: ppapi/shared_impl/private/net_address_private_impl.h

Issue 16331007: Introduce PPB_NetAddress_Dev. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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/shared_impl/private/net_address_private_impl.h
diff --git a/ppapi/shared_impl/private/net_address_private_impl.h b/ppapi/shared_impl/private/net_address_private_impl.h
index 248ae1448cf522781bc009fe44cafdb1aeb3b449..fdc9577e6eb55b3b1a530d6720db2031654b40f8 100644
--- a/ppapi/shared_impl/private/net_address_private_impl.h
+++ b/ppapi/shared_impl/private/net_address_private_impl.h
@@ -9,6 +9,7 @@
#include <vector>
#include "base/basictypes.h"
+#include "ppapi/c/dev/ppb_net_address_dev.h"
#include "ppapi/c/pp_stdint.h"
#include "ppapi/shared_impl/ppapi_shared_export.h"
@@ -36,6 +37,25 @@ class PPAPI_SHARED_EXPORT NetAddressPrivateImpl {
static std::string DescribeNetAddress(const PP_NetAddress_Private& addr,
bool include_port);
+ // Conversion methods to make PPB_NetAddress_Dev resource work with
+ // PP_NetAddress_Private.
+ // TODO(yzshen): Remove them once PPB_NetAddress_Dev resource doesn't use
+ // PP_NetAddress_Private as storage type.
+ static void CreateNetAddressPrivateFromIPv4Address(
bbudge 2013/06/06 19:01:10 Could we use method overloading to avoid the "From
yzshen1 2013/06/06 20:57:15 I think the style guide prefers not to use overloa
+ const PP_NetAddress_IPv4_Dev& ipv4_addr,
+ PP_NetAddress_Private* addr);
+ static void CreateNetAddressPrivateFromIPv6Address(
+ const PP_NetAddress_IPv6_Dev& ipv6_addr,
+ PP_NetAddress_Private* addr);
+ static PP_NetAddress_Family_Dev GetFamilyFromNetAddressPrivate(
+ const PP_NetAddress_Private& addr);
+ static bool DescribeNetAddressPrivateAsIPv4Address(
+ const PP_NetAddress_Private& addr,
+ PP_NetAddress_IPv4_Dev* ipv4_addr);
+ static bool DescribeNetAddressPrivateAsIPv6Address(
+ const PP_NetAddress_Private& addr,
+ PP_NetAddress_IPv6_Dev* ipv6_addr);
+
static const PP_NetAddress_Private kInvalidNetAddress;
private:

Powered by Google App Engine
This is Rietveld 408576698