
Public Member Functions
| HostResolver () | |
| HostResolver (const InstanceHandle &instance) | |
| HostResolver (PassRef, PP_Resource resource) | |
| HostResolver (const HostResolver &other) | |
| virtual | ~HostResolver () |
| HostResolver & | operator= (const HostResolver &other) |
| int32_t | Resolve (const char *host, uint16_t port, const PP_HostResolver_Hint &hint, const CompletionCallback &callback) |
| Var | GetCanonicalName () const |
| uint32_t | GetNetAddressCount () const |
| NetAddress | GetNetAddress (uint32_t index) const |
Static Public Member Functions
| static bool | IsAvailable () |
Detailed Description
The HostResolver class supports host name resolution.
Permissions: In order to run Resolve(), apps permission socket with subrule resolve-host is required. For more details about network communication permissions, please see: /apps/app_network.html
Constructor & Destructor Documentation
Default constructor for creating an is_null() HostResolver object.
| pp::HostResolver::HostResolver | ( | const InstanceHandle & | instance | ) | [explicit] |
A constructor used to create a HostResolver object.
- Parameters:
[in] instance The instance with which this resource will be associated.
| pp::HostResolver::HostResolver | ( | PassRef | , |
| PP_Resource | resource | ||
| ) |
A constructor used when you have received a PP_Resource as a return value that has had 1 ref added for you.
- Parameters:
[in] resource A PPB_HostResolverresource.
| pp::HostResolver::HostResolver | ( | const HostResolver & | other | ) |
The copy constructor for HostResolver.
- Parameters:
[in] other A reference to another HostResolver.
| virtual pp::HostResolver::~HostResolver | ( | ) | [virtual] |
The destructor.
Member Function Documentation
| NetAddress pp::HostResolver::GetNetAddress | ( | uint32_t | index | ) | const |
Gets a network address.
- Parameters:
[in] index An index indicating which address to return.
- Returns:
- A
NetAddressobject. The object will be null (i.e., is_null() returns true) if there is a pendingResolve()call or the previousResolve()call failed, or the specified index is out of range.
| uint32_t pp::HostResolver::GetNetAddressCount | ( | ) | const |
| static bool pp::HostResolver::IsAvailable | ( | ) | [static] |
Static function for determining whether the browser supports the PPB_HostResolver interface.
- Returns:
- true if the interface is available, false otherwise.
| HostResolver& pp::HostResolver::operator= | ( | const HostResolver & | other | ) |
The assignment operator for HostResolver.
- Parameters:
[in] other A reference to another HostResolver.
- Returns:
- A reference to this
HostResolverobject.
| int32_t pp::HostResolver::Resolve | ( | const char * | host, |
| uint16_t | port, | ||
| const PP_HostResolver_Hint & | hint, | ||
| const CompletionCallback & | callback | ||
| ) |
Requests resolution of a host name.
If the call completes successully, the results can be retrieved by GetCanonicalName(), GetNetAddressCount() and GetNetAddress().
- Parameters:
[in] host The host name (or IP address literal) to resolve. [in] port The port number to be set in the resulting network addresses. [in] hint A PP_HostResolver_Hintstructure providing hints for host resolution.[in] callback A CompletionCallbackto be called upon completion.
- Returns:
- An int32_t containing an error code from
pp_errors.h.PP_ERROR_NOACCESSwill be returned if the caller doesn't have required permissions.PP_ERROR_NAME_NOT_RESOLVEDwill be returned if the host name couldn't be resolved.
The documentation for this class was generated from the following file: