3.16 <WebKitSecurityOrigin>

Structure: <WebKitSecurityOrigin>

A security boundary for websites.

<WebKitSecurityOrigin> is a representation of a security domain defined by websites. A security origin consists of a protocol, a hostname, and an optional port number.

Resources with the same security origin can generally access each other for client-side scripting or database access. When comparing origins, beware that if both protocol and host are #f, the origins should not be treated as equal.

Procedures

Method: security-origin:get-host self ⇒ %return
Method: get-host self ⇒ %return

Gets the hostname of self.

It is reasonable for this to be #f if its protocol does not require a host component.

self

Passed: a <WebKitSecurityOrigin>.

a <WebKitSecurityOrigin>

%return

Returned: a string, or #f.

The host of the <WebKitSecurityOrigin>

Method: security-origin:get-port self ⇒ %return
Method: get-port self ⇒ %return

Gets the port of self.

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.

self

Passed: a <WebKitSecurityOrigin>.

a <WebKitSecurityOrigin>

%return

Returned: an unsigned 16-bit integer.

The port of the <WebKitSecurityOrigin>.

Method: security-origin:get-protocol self ⇒ %return
Method: get-protocol self ⇒ %return

Gets the protocol of self.

self

Passed: a <WebKitSecurityOrigin>.

a <WebKitSecurityOrigin>

%return

Returned: a string, or #f.

The protocol of the <WebKitSecurityOrigin>

Procedure: security-origin:new protocol host port ⇒ %return

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

protocol

Passed: a string.

The protocol for the new origin

host

Passed: a string.

The host for the new origin

port

Passed: an unsigned 16-bit integer.

The port number for the new origin, or 0 to indicate the default port for protocol

%return

Returned: a <WebKitSecurityOrigin>.

A <WebKitSecurityOrigin>.

Procedure: security-origin:new-for-uri uri ⇒ %return

Create a new security origin from the provided.

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

uri

Passed: a string.

The URI for the new origin

%return

Returned: a <WebKitSecurityOrigin>.

A <WebKitSecurityOrigin>.

Method: security-origin:ref self ⇒ %return
Method: ref self ⇒ %return

Atomically increments the reference count of self by one.

This function is MT-safe and may be called from any thread.

self

Passed: a <WebKitSecurityOrigin>.

a <WebKitSecurityOrigin>

%return

Returned: a <WebKitSecurityOrigin>.

The passed <WebKitSecurityOrigin>

Method: security-origin:to-string self ⇒ %return
Method: to-string self ⇒ %return

Gets a string representation of self.

The string representation is a valid URI with only protocol, host, and port components, or #f.

self

Passed: a <WebKitSecurityOrigin>.

a <WebKitSecurityOrigin>

%return

Returned: a string, or #f.

a URI representing self.

Method: security-origin:unref self
Method: unref self

Atomically decrements the reference count of self 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.

self

Passed: a <WebKitSecurityOrigin>.

A <WebKitSecurityOrigin>