struct EE::UI::WebOriginKey

Overview

Canonical network origin used to describe a document navigation. More…

#include <webresourcecache.hpp>

struct WebOriginKey {
    // fields

    std::string scheme;
    std::string host;
    Uint16 port { 0 };

    // methods

    bool empty() const;
    bool operator==(const WebOriginKey& other) const;
    bool operator!=(const WebOriginKey& other) const;
    static WebOriginKey fromURI(const Network::URI& uri);
};

Detailed Documentation

Canonical network origin used to describe a document navigation.

Origins compare scheme, host, and port. Consequently HTTP and HTTPS origins are distinct, as are equal hosts using different ports. Paths, queries, and fragments are not part of an origin.

Fields

std::string scheme

Lowercase URI scheme, such as “http” or “https”.

std::string host

Lowercase host name.

Uint16 port { 0 }

URI port, or the URI implementation’s default/empty port value.

Methods

bool empty() const

Returns:

True when no origin components have been assigned.

bool operator==(const WebOriginKey& other) const

Returns:

True when both values describe the same scheme, host, and port.

bool operator!=(const WebOriginKey& other) const

Returns:

True when at least one origin component differs.

static WebOriginKey fromURI(const Network::URI& uri)

Creates an origin key from a URI, normalizing the scheme and host to lowercase.