gi-webkit-6.0.2: WebKit bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.WebKit.Structs.SecurityOrigin

Description

A security boundary for websites.

SecurityOrigin 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 Nothing, the origins should not be treated as equal.

Since: 2.16

Synopsis

Exported types

newtype SecurityOrigin Source #

Memory-managed wrapper type.

Constructors

SecurityOrigin (ManagedPtr SecurityOrigin) 

Instances

Instances details
Eq SecurityOrigin Source # 
Instance details

Defined in GI.WebKit.Structs.SecurityOrigin

GBoxed SecurityOrigin Source # 
Instance details

Defined in GI.WebKit.Structs.SecurityOrigin

ManagedPtrNewtype SecurityOrigin Source # 
Instance details

Defined in GI.WebKit.Structs.SecurityOrigin

TypedObject SecurityOrigin Source # 
Instance details

Defined in GI.WebKit.Structs.SecurityOrigin

Methods

glibType :: IO GType

HasParentTypes SecurityOrigin Source # 
Instance details

Defined in GI.WebKit.Structs.SecurityOrigin

IsGValue (Maybe SecurityOrigin) Source #

Convert SecurityOrigin to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.WebKit.Structs.SecurityOrigin

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe SecurityOrigin -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe SecurityOrigin)

type ParentTypes SecurityOrigin Source # 
Instance details

Defined in GI.WebKit.Structs.SecurityOrigin

type ParentTypes SecurityOrigin = '[] :: [Type]

Methods

Click to display all available methods, including inherited ones

Expand

Methods

ref, toString, unref.

Getters

getHost, getPort, getProtocol.

Setters

None.

getHost

securityOriginGetHost Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> SecurityOrigin

origin: a SecurityOrigin

-> m (Maybe Text)

Returns: The host of the SecurityOrigin

Gets the hostname of origin.

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

Since: 2.16

getPort

securityOriginGetPort Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> SecurityOrigin

origin: a SecurityOrigin

-> m Word16

Returns: The port of the SecurityOrigin.

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 SecurityOrigin constructed from either URI.

Since: 2.16

getProtocol

securityOriginGetProtocol Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> SecurityOrigin

origin: a SecurityOrigin

-> m (Maybe Text)

Returns: The protocol of the SecurityOrigin

Gets the protocol of origin.

Since: 2.16

new

securityOriginNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

protocol: The protocol for the new origin

-> Text

host: The host for the new origin

-> Word16

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

-> m SecurityOrigin

Returns: A SecurityOrigin.

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

Since: 2.16

newForUri

securityOriginNewForUri Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

uri: The URI for the new origin

-> m SecurityOrigin

Returns: A SecurityOrigin.

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 SecurityOrigin.

Since: 2.16

ref

securityOriginRef Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> SecurityOrigin

origin: a SecurityOrigin

-> m SecurityOrigin

Returns: The passed SecurityOrigin

Atomically increments the reference count of origin by one.

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

Since: 2.16

toString

securityOriginToString Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> SecurityOrigin

origin: a SecurityOrigin

-> m (Maybe Text)

Returns: a URI representing origin.

Gets a string representation of origin.

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

Since: 2.16

unref

securityOriginUnref Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> SecurityOrigin

origin: A SecurityOrigin

-> m () 

Atomically decrements the reference count of origin by one.

If the reference count drops to 0, all memory allocated by SecurityOrigin is released. This function is MT-safe and may be called from any thread.

Since: 2.16