@brief Defines the controller API for native ArkWeb.
Before invoking an API, you are advised to use ARKWEB_MEMBER_MISSING to check
whether the function structure has a corresponding function pointer to avoid crash
caused by mismatch between the SDK and the device ROM.
Use OH_ArkWeb_GetNativeAPI in the UI thread to obtain the Controller-related interface cluster.
@brief Defines the native CookieManager API for ArkWeb.
Before invoking an API, you are advised to use ARKWEB_MEMBER_MISSING to check
whether the function structure has a corresponding function pointer to avoid crash
caused by mismatch between the SDK and the device ROM.
Use OH_ArkWeb_GetNativeAPI in the UI thread to obtain the CookieManager-related interface cluster.
@brief Defines the web message data API for native ArkWeb.
Before invoking an API, you are advised to use ARKWEB_MEMBER_MISSING to check
whether the function structure has a corresponding function pointer to avoid crash
caused by mismatch between the SDK and the device ROM.
Use OH_ArkWeb_GetNativeAPI in the UI thread to obtain the WebMessage-related interface cluster.
@brief Defines the web message API for native ArkWeb.
Before invoking an API, you are advised to use ARKWEB_MEMBER_MISSING to check
whether the function structure has a corresponding function pointer to avoid crash
caused by mismatch between the SDK and the device ROM.
Use OH_ArkWeb_GetNativeAPI in the UI thread to obtain the WebMessagePort-related interface cluster.
If ARKWEB_SCHEME_OPTION_CORS_ENABLED is set, then the scheme can be sent CORS requests. In most cases this
value should be set when ARKWEB_SCHEME_OPTION_STANDARD is set.
If ARKWEB_SCHEME_OPTION_CSP_BYPASSING is set, then this scheme can bypass Content Security Policy (CSP)
checks. In most cases, this value should not be set when ARKWEB_SCHEME_OPTION_STANDARD is set.
If ARKWEB_SCHEME_OPTION_STANDARD is set, the scheme will be handled as a standard scheme. The standard
schemes need to comply with the URL normalization and parsing rules defined in Section 3.1 of RFC 1738,
which can be found in the http://www.ietf.org/rfc/rfc1738.txt.
@error The request failed because the response was delivered along with requirements
which are not met (‘X-Frame-Options’ and ‘Content-Security-Policy’ ancestor
checks and ‘Cross-Origin-Resource-Policy’ for instance).
@error The server responded with a certificate that is signed by an authority
we don’t trust. The could mean:
1. An attacker has substituted the real certificate for a cert that
contains their public key and is signed by their cousin.
2. The server operator has a legitimate certificate from a CA we don’t
know about, but should trust.
3. The server is presenting a self-signed certificate, providing no
defense against active attackers (but foiling passive attackers).
@error The server responded with a certificate whose common name did not match
the host name. This could mean:
1. An attacker has redirected our traffic to their server and is
presenting a certificate for which they know the private key.
2. The server is misconfigured and responding with the wrong cert.
3. The user is on a wireless network and is being redirected to the
network’s login page.
4. The OS has used a DNS search suffix and the server doesn’t have
a certificate for the abbreviated name in the address bar.
@error The server responded with a certificate that contains errors.
This error is not recoverable.
MSDN describes this error as follows:
“The SSL certificate contains errors.”
NOTE: It’s unclear how this differs from ERR_CERT_INVALID. For consistency,
use that code instead of this one from now on.
@error The server responded with a certificate that, by our clock, appears to
either not yet be valid or to have expired. This could mean:
1. An attacker is presenting an old certificate for which they have
managed to obtain the private key.
2. The server is misconfigured and is not presenting a valid cert.
3. Our clock is wrong.
@error The server responded with a certificate that is invalid.
This error is not recoverable.
MSDN describes this error as follows:
“The SSL certificate is invalid.”
@error Revocation information for the security certificate for this site is not
available. This could mean:
1. An attacker has compromised the private key in the certificate and is
blocking our attempt to find out that the cert was revoked.
2. The certificate is unrevoked, but the revocation server is busy or
unavailable.
@error DNS identified the request as disallowed for insecure connection (http/ws).
Error should be handled as if an HTTP redirect was received to redirect to
https or wss.
@error DNS server failed. This error is returned for all of the following
error conditions:
1 - Format error - The name server was unable to interpret the query.
2 - Server failure - The name server was unable to process this query
due to a problem with the name server.
4 - Not Implemented - The name server does not support the requested
kind of query.
5 - Refused - The name server refuses to perform the specified
operation for policy reasons.
@error TLS 1.3 early data was rejected by the server. This will be received before
any data is returned from the socket. The request should be retried with
early data disabled.
@error ECH was enabled, the server was unable to decrypt the encrypted ClientHello,
and additionally did not present a certificate valid for the public name.
@error A pushed HTTP/2 stream was claimed by a request based on matching URL and
request headers, but the pushed response headers do not match the request.
@error Received HTTP/2 RST_STREAM frame with NO_ERROR error code. This error should
be handled internally by HTTP/2 code, and should not make it above the
SpdyStream layer.
@error HTTP/2 server refused the request without processing, and sent either a
GOAWAY frame with error code NO_ERROR and Last-Stream-ID lower than the
stream id corresponding to the request indicating that this request has not
been processed yet, or a RST_STREAM frame with error code REFUSED_STREAM.
Client MAY retry (on a different connection). See RFC7540 Section 8.1.4.
@error A request to create an SSL tunnel connection through the HTTPS proxy
received a 302 (temporary redirect, response. The response body might
include a description of why the request failed.
@error Resolving a hostname to an IP address list included the IPv4 address
“127.0.53.53”. This is a special IP address which ICANN has recommended to
indicate there was a name collision, and alert admins to a potential
problem.
@error The HTTP response body is transferred with Chunked-Encoding, but the
terminating zero-length chunk was never sent when the connection is closed.
@error HTTP/2 headers have been received, but not all of them - status or version
headers are missing, so we’re expecting additional frames to complete them.
@error The IP address space of the remote endpoint differed from the previous
observed value during the same request. Any cache entry for the affected
request should be invalidated.
@error An asynchronous IO operation is not yet complete. This usually does not
indicate a fatal error. Typically this error will be generated as a
notification to wait for some external notification that the IO operation
finally completed.
@error Permission to access the network was denied. This is used to distinguish
errors that were most likely caused by a firewall from other access denied
errors. See also ERR_ACCESS_DENIED.
@error No PAC URL configuration could be retrieved from DHCP. This can indicate
either a failure to retrieve the DHCP configuration, or that there was no
PAC URL configured in DHCP.
@error Could not create a connection to the proxy server. An error occurred
either in resolving its name, or in connecting a socket to it.
Note that this does NOT include failures during the actual “CONNECT” method
of an HTTP proxy.
@error The certificate presented on a QUIC connection does not chain to a known root
and the origin connected to is not on a list of domains where unknown roots
are allowed.
@error We were unable to sign the CertificateVerify data of an SSL client auth
handshake with the client certificate’s private key.
Possible causes for this include the user implicitly or explicitly
denying access to the private key, the private key may not be valid for
signing, the key may be relying on a cached handle which is no longer
valid, or the CSP won’t allow arbitrary data to be signed.
@error An SSL peer sent us a fatal decompression_failure alert. This typically
occurs when a peer selects DEFLATE compression in the mistaken belief that
it supports it.
@error An SSL peer sent us a fatal decrypt_error alert. This typically occurs when
a peer could not correctly verify a signature (in CertificateVerify or
ServerKeyExchange, or validate a Finished message.
@error The SSL server required an unsupported cipher suite that has since been
removed. This error will temporarily be signaled on a fallback for one or two
releases immediately following a cipher suite’s removal, after which the
fallback will be removed.
@error The certificate didn’t match the built-in public key pins for the host name.
The pins are set in net/http/transport_security_state.cc and require that
one of a set of public keys exist on the path from the leaf to the root.
@error The SSL server presented a certificate which could not be decoded. This is
not a certificate error code as no X509Certificate object is available. This
error is fatal.
@error TLS 1.3 was enabled, but a lower version was negotiated and the server
returned a value indicating it supported TLS 1.3. This is part of a security
check in TLS 1.3, but it may also indicate the user is behind a buggy
TLS-terminating proxy which implemented TLS 1.2 incorrectly. (See
rhttps://crbug.com/boringssl/226.,
@error When handling a Trust Tokens protocol operation-executing request, the system
was able to execute the request’s Trust Tokens operation without sending the
request to its destination.
@error The attempt to reuse a connection to send proxy auth credentials failed
before the AuthController was used to generate credentials. The caller should
reuse the controller with a new connection. This error is only used
internally by the network stack.
@error The upload failed because the upload stream needed to be re-read, due to a
retry or a redirect, but the upload stream doesn’t support that operation.
@error TLS 1.3 early data was offered, but the server responded with TLS 1.2 or
earlier. This is an internal error code to account for a
backwards-compatibility issue with early data and TLS 1.2. It will be
received before any data is returned from the socket. The request should be
retried with early data disabled.
See https://tools.ietf.org/html/rfc8446#appendix-D.3 for details.
@brief Get the current position of the data stream.
@param httpBodyStream The ArkWeb_HttpBodyStream.
@return The current position of data stream. 0 if httpBodyStream is invalid.
@brief Set a user data to ArkWeb_HttpBodyStream.
@param httpBodyStream The ArkWeb_HttpBodyStream.
@param userData The user data to set.
@return {@link ARKWEB_NET_OK} 0 - Success.
{@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.
@brief Get the specified request header.
@param requestHeaderList The list of request header.
@param index The index of request header.
@param key The header key. Caller must release the string by OH_ArkWeb_ReleaseString.
@param value The header value. Caller must release the string by OH_ArkWeb_ReleaseString.
@brief Get the request headers size.
@param requestHeaderList The list of request header.
@return The size of request headers. -1 if requestHeaderList is invalid.
@brief Notify the ArkWeb that this request should be failed.
@param resourceHandler The ArkWeb_ResourceHandler for the request.
@param errorCode The error code for this request. Refer to arkweb_net_error_list.h.
@return {@link ARKWEB_NET_OK} 0 - Success.
{@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.
@brief Notify the ArkWeb that this request should be finished and there is no more data available.
@param resourceHandler The ArkWeb_ResourceHandler for the request.
@return {@link ARKWEB_NET_OK} 0 - Success.
{@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.
@brief Pass response body data to intercepted requests.
@param resourceHandler The ArkWeb_ResourceHandler for the request.
@param buffer Buffer data to send.
@param bufLen The size of buffer.
@return {@link ARKWEB_NET_OK} 0 - Success.
{@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.
@brief Pass response headers to intercepted requests.
@param resourceHandler The ArkWeb_ResourceHandler for the request.
@param response The ArkWeb_Response for the intercepting requests.
@return {@link ARKWEB_NET_OK} 0 - Success.
{@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.
@brief Get the url of frame which trigger this request.
@param resourceRequest The ArkWeb_ResourceRequest.
@param frameUrl The url of frame which trigger this request. This function will allocate memory for the url string
and caller must release the string by OH_ArkWeb_ReleaseString.
@brief Create a ArkWeb_HttpBodyStream which used to read the http body.
@param resourceRequest The ArkWeb_ResourceRequest.
@param httpBodyStream The request’s http body. This function will allocate memory for the http body stream and
caller must release the httpBodyStream by OH_ArkWebResourceRequest_DestroyHttpBodyStream.
@brief Get the method of request.
@param resourceRequest The ArkWeb_ResourceRequest.
@param method The request’s http method. This function will allocate memory for the method string and caller must
release the string by OH_ArkWeb_ReleaseString.
@brief Get the referrer of request.
@param resourceRequest The ArkWeb_ResourceRequest.
@param referrer The request’s referrer. This function will allocate memory for the post data string and caller
must release the string by OH_ArkWeb_ReleaseString.
@brief Get the OH_ArkWeb_RequestHeaderList of the request.
@param resourceRequest The ArkWeb_ResourceRequest.
@param requestHeaderList The RequestHeaderList of request.
@brief Get the resource type of request.
@param resourceRequest The ArkWeb_ResourceRequest.
@return The resource type of request. -1 if resourceRequest is invalid.
@brief Get the url of request.
@param resourceRequest The ArkWeb_ResourceRequest.
@param url The request’s url. This function will allocate memory for the url string and caller must release the
string by OH_ArkWeb_ReleaseString.
@brief Get if this is a request is triggered by user gesutre.
@param resourceRequest The ArkWeb_ResourceRequest.
@return True if this is triggered by user gesture; false otherwise.
@brief Get if this is a request from main frame.
@param resourceRequest The ArkWeb_ResourceRequest.
@return True if this is from main frame; false otherwise.
@brief Set a user data to ArkWeb_ResourceRequest.
@param resourceRequest The ArkWeb_ResourceRequest.
@param userData The user data to set.
@return {@link ARKWEB_NET_OK} 0 - Success.
{@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.
@brief Get the response’s charset.
@param response The ArkWeb_Response.
@param charset Return the response’s charset. This function will allocate memory for the charset string and caller
must release the string by OH_ArkWeb_ReleaseString.
@brief Get the header from the response.
@param response The ArkWeb_Response.
@param name The name of the header.
@param value Return the header’s value. This function will allocate memory for the value string and caller must
release the string by OH_ArkWeb_ReleaseString.
@brief Get the response’s mime type.
@param response The ArkWeb_Response.
@param mimeType Return the response’s mime type. This function will allocate memory for the mime type string and
caller must release the string by OH_ArkWeb_ReleaseString.
@brief Get the response’s status text.
@param response The ArkWeb_Response.
@param statusText Return the response’s statusText. This function will allocate memory for the statusText string and
caller must release the string by OH_ArkWeb_ReleaseString.
@brief Set charset to ArkWeb_Response.
@param response The ArkWeb_Response.
@param charset The charset for the request.
@return {@link ARKWEB_NET_OK} 0 - Success.
{@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.
@brief Set a error code to ArkWeb_Response.
@param response The ArkWeb_Response.
@param errorCode The error code for the failed request.
@return {@link ARKWEB_NET_OK} 0 - Success.
{@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.
@brief Set a header to ArkWeb_Response.
@param response The ArkWeb_Response.
@param name The name of the header.
@param value The value of the header.
@param overwirte If true will overwrite the exsits header, if false otherwise.
@return {@link ARKWEB_NET_OK} 0 - Success.
{@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.
@brief Set mime type to ArkWebResponse.
@param response The ArkWeb_Response.
@param mimeType The mime type for the request.
@return {@link ARKWEB_NET_OK} 0 - Success.
{@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.
@brief Set a status code to ArkWebResponse.
@param response The ArkWeb_Response.
@param status The http status code for the request.
@return {@link ARKWEB_NET_OK} 0 - Success.
{@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.
@brief Set a status text to ArkWebResponse.
@param response The ArkWeb_Response.
@param statusText The status text for the request.
@return {@link ARKWEB_NET_OK} 0 - Success.
{@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.
@brief Set the resolved URL after redirects or changed as a result of HSTS.
@param response The ArkWeb_Response.
@param url The resolved URL.
@return {@link ARKWEB_NET_OK} 0 - Success.
{@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.
@brief Set the OnRequestStart callback for SchemeHandler.
@param schemeHandler The SchemeHandler for the scheme.
@param onRequestStart The OnRequestStart callback.
@return {@link ARKWEB_NET_OK} 0 - Success.
{@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.
@brief Set the OnRequestStop callback for SchemeHandler.
@param schemeHandler The SchemeHandler for the scheme.
@param onRequestStop The OnRequestStop callback.
@return {@link ARKWEB_NET_OK} 0 - Success.
{@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.
@brief Set a user data to ArkWeb_SchemeHandler.
@param schemeHandler The ArkWeb_SchemeHandler.
@param userData The user data to set.
@return {@link ARKWEB_NET_OK} 0 - Success.
{@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.
@brief Clear the handler registered on the specified web.
@param webTag The name of the web component.
@return {@link ARKWEB_NET_OK} 0 - Success.
{@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.
@brief Create a SchemeHandler.
@param schemeHandler Return the created SchemeHandler. Use OH_ArkWeb_DestroySchemeHandler destroy it when donn’t
need it.
@brief Obtains the native API set of a specified type.
@param type Indicates the type of the native API set provided by ArkWeb.
@return Return the pointer to the native API abstract object that carries the size.
If the type is incorrect, a null pointer is returned.
@brief Callback when the init operation done.
@param httpBodyStream The ArkWeb_HttpBodyStream.
@param result {@link ARKWEB_NET_OK} on success otherwise refer to arkweb_net_error_list.h.
@brief Callback when the read operation done.
@param httpBodyStream The ArkWeb_HttpBodyStream.
@param buffer The buffer to receive data.
@param bytesRead Callback after OH_ArkWebHttpBodyStream_Read. bytesRead greater than 0 means that the buffer is
filled with data of bytesRead size. Caller can read from the buffer, and if
OH_ArkWebHttpBodyStream_IsEOF is false, caller can continue to read the remaining data.