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

Unified Diff: ppapi/cpp/dev/net_address_dev.h

Issue 16938011: Update comments of the Pepper networking APIs. (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/cpp/dev/net_address_dev.h
diff --git a/ppapi/cpp/dev/net_address_dev.h b/ppapi/cpp/dev/net_address_dev.h
index e7039801d3bb91e9187fa987f3accf4555d127fd..579cc532e7b9abd51ccddc07869f977c199c3068 100644
--- a/ppapi/cpp/dev/net_address_dev.h
+++ b/ppapi/cpp/dev/net_address_dev.h
@@ -14,36 +14,98 @@ namespace pp {
class InstanceHandle;
+/// The <code>NetAddress_Dev</code> class represents a network address.
class NetAddress_Dev : public Resource {
public:
+ /// Default constructor for creating an is_null() <code>NetAddress_Dev</code>
+ /// object.
NetAddress_Dev();
+ /// A constructor used when you have received a <code>PP_Resource</code> as a
+ /// return value that has already been added 1 ref for you.
bbudge 2013/06/20 21:02:32 s/been added 1 ref for you/has had 1 ref added for
yzshen1 2013/06/20 22:20:48 Done.
+ ///
+ /// @param[in] resource A <code>PPB_NetAddress_Dev</code> resource.
NetAddress_Dev(PassRef, PP_Resource resource);
+ /// A contructor used to create a <code>NetAddress_Dev</code> object with the
bbudge 2013/06/20 21:02:32 s/contructor/constructor
yzshen1 2013/06/20 22:20:48 Done.
+ /// specified IPv4 address.
+ ///
+ /// @param[in] instance The instance with which this resource will be
+ /// associated.
+ /// @param[in] ipv4_addr An IPv4 address.
NetAddress_Dev(const InstanceHandle& instance,
const PP_NetAddress_IPv4_Dev& ipv4_addr);
+ /// A contructor used to create a <code>NetAddress_Dev</code> object with the
bbudge 2013/06/20 21:02:32 s/contructor/constructor
yzshen1 2013/06/20 22:20:48 Done.
+ /// specified IPv6 address.
+ ///
+ /// @param[in] instance The instance with which this resource will be
+ /// associated.
+ /// @param[in] ipv6_addr An IPv6 address.
NetAddress_Dev(const InstanceHandle& instance,
const PP_NetAddress_IPv6_Dev& ipv6_addr);
+ /// The copy constructor for <code>NetAddress_Dev</code>.
+ ///
+ /// @param[in] other A reference to another <code>NetAddress_Dev</code>.
NetAddress_Dev(const NetAddress_Dev& other);
+ /// The destructor.
virtual ~NetAddress_Dev();
+ /// The assign operator for <code>NetAddress_Dev</code>.
bbudge 2013/06/20 21:02:32 s/assign/assignment
yzshen1 2013/06/20 22:20:48 Done.
+ ///
+ /// @param[in] other A reference to another <code>NetAddress_Dev</code>.
+ ///
+ /// @return A reference to this <code>NetAddress_Dev</code> object.
NetAddress_Dev& operator=(const NetAddress_Dev& other);
/// Static function for determining whether the browser supports the required
bbudge 2013/06/20 21:02:32 s/required//
yzshen1 2013/06/20 22:20:48 Done.
- /// NetAddress interface.
+ /// <code>PPB_NetAddress_Dev</code> interface.
///
/// @return true if the interface is available, false otherwise.
static bool IsAvailable();
+ /// Gets the address family.
+ ///
+ /// @return The address family on success;
+ /// <code>PP_NETADDRESS_FAMILY_UNSPECIFIED</code> on failure.
PP_NetAddress_Family_Dev GetFamily() const;
+ /// Returns a human-readable description of the network address. The
+ /// description is in the form of host [ ":" port ] and conforms to
+ /// http://tools.ietf.org/html/rfc3986#section-3.2 for IPv4 and IPv6 addresses
+ /// (e.g., "192.168.0.1", "192.168.0.1:99", or "[::1]:80").
+ ///
+ /// @param[in] include_port Whether to include the port number in the
+ /// description.
+ ///
+ /// @return A string <code>Var</code> on success; an undefined
+ /// <code>Var</code> on failure.
Var DescribeAsString(bool include_port) const;
+ /// Fills a <code>PP_NetAddress_IPv4_Dev</code> structure if the network
+ /// address is of <code>PP_NETADDRESS_FAMILY_IPV4</code> address family.
+ /// Note that passing a network address of
+ /// <code>PP_NETADDRESS_FAMILY_IPV6</code> address family will fail even if
+ /// the address is an IPv4-mapped IPv6 address.
+ ///
+ /// @param[out] ipv4_addr A <code>PP_NetAddress_IPv4_Dev</code> structure to
+ /// store the result.
+ ///
+ /// @return A boolean value indicating whether the operation succeeded.
bool DescribeAsIPv4Address(PP_NetAddress_IPv4_Dev* ipv4_addr) const;
+ /// Fills a <code>PP_NetAddress_IPv6_Dev</code> structure if the network
+ /// address is of <code>PP_NETADDRESS_FAMILY_IPV6</code> address family.
+ /// Note that passing a network address of
+ /// <code>PP_NETADDRESS_FAMILY_IPV4</code> address family will fail - this
+ /// method doesn't map it to an IPv6 address.
+ ///
+ /// @param[out] ipv6_addr A <code>PP_NetAddress_IPv6_Dev</code> structure to
+ /// store the result.
+ ///
+ /// @return A boolean value indicating whether the operation succeeded.
bool DescribeAsIPv6Address(PP_NetAddress_IPv6_Dev* ipv6_addr) const;
};

Powered by Google App Engine
This is Rietveld 408576698