Data Fields
PP_Resource(* | Create )(PP_Instance instance) |
PP_Bool(* | IsHostResolver )(PP_Resource resource) |
int32_t(* | Resolve )(PP_Resource host_resolver, const char *host, uint16_t port, const struct PP_HostResolver_Hint *hint, struct PP_CompletionCallback callback) |
struct PP_Var(* | GetCanonicalName )(PP_Resource host_resolver) |
uint32_t(* | GetNetAddressCount )(PP_Resource host_resolver) |
PP_Resource(* | GetNetAddress )(PP_Resource host_resolver, uint32_t index) |
Detailed Description
The PPB_HostResolver
interface 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
Field Documentation
PP_Resource(* PPB_HostResolver::Create)(PP_Instance instance) |
Creates a host resolver resource.
- Parameters:
[in] instance A PP_Instance
identifying one instance of a module.
- Returns:
- A
PP_Resource
corresponding to a host reslover or 0 on failure.
struct PP_Var(* PPB_HostResolver::GetCanonicalName)(PP_Resource host_resolver) [read] |
Gets the canonical name of the host.
- Parameters:
[in] host_resolver A PP_Resource
corresponding to a host resolver.
PP_Resource(* PPB_HostResolver::GetNetAddress)(PP_Resource host_resolver, uint32_t index) |
Gets a network address.
- Parameters:
[in] host_resolver A PP_Resource
corresponding to a host resolver.[in] index An index indicating which address to return.
uint32_t(* PPB_HostResolver::GetNetAddressCount)(PP_Resource host_resolver) |
PP_Bool(* PPB_HostResolver::IsHostResolver)(PP_Resource resource) |
Determines if a given resource is a host resolver.
- Parameters:
[in] resource A PP_Resource
to check.
- Returns:
PP_TRUE
if the input is aPPB_HostResolver
resource;PP_FALSE
otherwise.
int32_t(* PPB_HostResolver::Resolve)(PP_Resource host_resolver, const char *host, uint16_t port, const struct PP_HostResolver_Hint *hint, struct PP_CompletionCallback callback) |
Requests resolution of a host name.
If the call completes successfully, the results can be retrieved by GetCanonicalName()
, GetNetAddressCount()
and GetNetAddress()
.
- Parameters:
[in] host_resolver A PP_Resource
corresponding to a host resolver.[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_Hint
structure providing hints for host resolution.[in] callback A PP_CompletionCallback
to be called upon completion.
- Returns:
- An int32_t containing an error code from
pp_errors.h
.PP_ERROR_NOACCESS
will be returned if the caller doesn't have required permissions.PP_ERROR_NAME_NOT_RESOLVED
will be returned if the host name couldn't be resolved.
The documentation for this struct was generated from the following file: