SecurityOrigin

#WebKitSecurityOrigin is a representation of a security domain defined by websites. A security origin normally consists of a protocol, a hostname, and a port number. It is also possible for a security origin to be opaque, as defined by the HTML standard, in which case it has no associated protocol, host, or port.

Websites with the same security origin can access each other's resources for client-side scripting or database access.

Constructors

this
this(WebKitSecurityOrigin* webKitSecurityOrigin, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this(string protocol, string host, ushort port)

Create a new security origin from the provided protocol, host and port.

this
this(string uri)

Create a new security origin from the provided URI. Components of @uri other than protocol, host, and port do not affect the created #WebKitSecurityOrigin.

Destructor

~this
~this()
Undocumented in source.

Members

Aliases

doref
alias doref = ref_
Undocumented in source.

Functions

getHost
string getHost()

Gets the hostname of @origin, or %NULL if @origin is opaque or if its protocol does not require a host component.

getPort
ushort getPort()

Gets the port of @origin. This function will always return 0 if the port is the default port for the given protocol. For example, http://example.com has the same security origin as http://example.com:80, and this function will return 0 for a #WebKitSecurityOrigin constructed from either URI. It will also return 0 if @origin is opaque.

getProtocol
string getProtocol()

Gets the protocol of @origin, or %NULL if @origin is opaque.

getSecurityOriginStruct
WebKitSecurityOrigin* getSecurityOriginStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

isOpaque
bool isOpaque()

Gets whether @origin is an opaque security origin, which does not possess an associated protocol, host, or port.

ref_
SecurityOrigin ref_()

Atomically increments the reference count of @origin by one. This function is MT-safe and may be called from any thread.

toString
string toString()

Gets a string representation of @origin. The string representation is a valid URI with only protocol, host, and port components. It may be %NULL, but usually only if @origin is opaque.

unref
void unref()

Atomically decrements the reference count of @origin by one. If the reference count drops to 0, all memory allocated by #WebKitSecurityOrigin is released. This function is MT-safe and may be called from any thread.

Static functions

getType
GType getType()

Variables

ownedRef
bool ownedRef;
Undocumented in source.
webKitSecurityOrigin
WebKitSecurityOrigin* webKitSecurityOrigin;

the main Gtk struct

Meta

Since

2.16