WebKit2.SecurityOrigin¶
Fields¶
None
Methods¶
class  | 
  | 
class  | 
  | 
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
Details¶
- class WebKit2.SecurityOrigin¶
 A security boundary for websites.
WebKit2.SecurityOriginis 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
None, the origins should not be treated as equal.New in version 2.16.
- classmethod new(protocol, host, port)¶
 - Parameters:
 - Returns:
 - Return type:
 
Create a new security origin from the provided protocol, host and port.
New in version 2.16.
- classmethod new_for_uri(uri)¶
 - Parameters:
 uri (
str) – The URI for the new origin- Returns:
 - Return type:
 
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
WebKit2.SecurityOrigin.New in version 2.16.
- get_host()¶
 - Returns:
 The host of the
WebKit2.SecurityOrigin- Return type:
 
Gets the hostname of self.
It is reasonable for this to be
Noneif its protocol does not require a host component.New in version 2.16.
- get_port()¶
 - Returns:
 The port of the
WebKit2.SecurityOrigin.- Return type:
 
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
WebKit2.SecurityOriginconstructed from either URI.New in version 2.16.
- get_protocol()¶
 - Returns:
 The protocol of the
WebKit2.SecurityOrigin- Return type:
 
Gets the protocol of self.
New in version 2.16.
- is_opaque()¶
 - 
This function returns
False.This function returns
False.WebKit2.SecurityOriginis now a simple wrapper around a <protocol, host, port> triplet, and no longer represents an origin as defined by web standards that may be opaque.New in version 2.16.
Deprecated since version 2.32.
 
- ref()¶
 - Returns:
 The passed
WebKit2.SecurityOrigin- Return type:
 
Atomically increments the reference count of self by one.
This function is MT-safe and may be called from any thread.
New in version 2.16.
- to_string()¶
 - 
Gets a string representation of self.
The string representation is a valid URI with only protocol, host, and port components, or
None.New in version 2.16.
 
- unref()¶
 Atomically decrements the reference count of self by one.
If the reference count drops to 0, all memory allocated by
WebKit2.SecurityOriginis released. This function is MT-safe and may be called from any thread.New in version 2.16.