Struct xpcom::interfaces::nsICookieService
[−]
[src]
#[repr(C)]pub struct nsICookieService { /* fields omitted */ }
interface nsICookieService : nsISupports
/**
* nsICookieService
*
* Provides methods for setting and getting cookies in the context of a
* page load. See nsICookieManager for methods to manipulate the cookie
* database directly. This separation of interface is mainly historical.
*
* This service broadcasts the notifications detailed below when the cookie
* list is changed, or a cookie is rejected.
*
* NOTE: observers of these notifications *must* not attempt to change profile
* or switch into or out of private browsing mode from within the
* observer. Doing so will cause undefined behavior. Mutating the cookie
* list (e.g. by calling methods on nsICookieService and friends) is
* allowed, but beware that there may be pending notifications you haven't
* seen yet -- for instance, a "batch-deleted" notification will likely be
* immediately followed by "added". You may check the state of the cookie
* list to determine if this is the case.
*
* topic : "cookie-changed"
* broadcast whenever the cookie list changes in some way. see
* explanation of data strings below.
* subject: see below.
* data : "deleted"
* a cookie was deleted. the subject is an nsICookie2 representing
* the deleted cookie.
* "added"
* a cookie was added. the subject is an nsICookie2 representing
* the added cookie.
* "changed"
* a cookie was changed. the subject is an nsICookie2 representing
* the new cookie. (note that host, path, and name are invariant
* for a given cookie; other parameters may change.)
* "batch-deleted"
* a set of cookies was purged (typically, because they have either
* expired or because the cookie list has grown too large). The subject
* is an nsIArray of nsICookie2's representing the deleted cookies.
* Note that the array could contain a single cookie.
* "cleared"
* the entire cookie list was cleared. the subject is null.
*
* topic : "cookie-rejected"
* broadcast whenever a cookie was rejected from being set as a
* result of user prefs.
* subject: an nsIURI interface pointer representing the URI that attempted
* to set the cookie.
* data : none.
*
* topic : "third-party-cookie-accepted"
* broadcast whenever a third party cookie was accepted
* subject: an nsIURI interface pointer representing the URI that attempted
* to set the cookie.
* data : the referrer, or "?" if unknown
*
* topic : "third-party-cookie-rejected"
* broadcast whenever a third party cookie was rejected
* subject: an nsIURI interface pointer representing the URI that attempted
* to set the cookie.
* data : the referrer, or "?" if unknown
*/
Methods
impl nsICookieService
[src]
pub fn coerce<T: nsICookieServiceCoerce>(&self) -> &T
[src]
Cast this nsICookieService
to one of its base interfaces.
impl nsICookieService
[src]
pub const BEHAVIOR_ACCEPT: i64
BEHAVIOR_ACCEPT: i64 = 0
pub const BEHAVIOR_REJECT_FOREIGN: i64
BEHAVIOR_REJECT_FOREIGN: i64 = 1
pub const BEHAVIOR_REJECT: i64
BEHAVIOR_REJECT: i64 = 2
pub const BEHAVIOR_LIMIT_FOREIGN: i64
BEHAVIOR_LIMIT_FOREIGN: i64 = 3
pub const ACCEPT_NORMALLY: i64
ACCEPT_NORMALLY: i64 = 0
pub const ACCEPT_SESSION: i64
ACCEPT_SESSION: i64 = 2
pub const ACCEPT_FOR_N_DAYS: i64
ACCEPT_FOR_N_DAYS: i64 = 3
pub unsafe fn GetCookieString(
&self,
aURI: *const nsIURI,
aChannel: *const nsIChannel,
_retval: *mut *const c_char
) -> nsresult
[src]
&self,
aURI: *const nsIURI,
aChannel: *const nsIChannel,
_retval: *mut *const c_char
) -> nsresult
string getCookieString (in nsIURI aURI, in nsIChannel aChannel);
pub unsafe fn GetCookieStringFromHttp(
&self,
aURI: *const nsIURI,
aFirstURI: *const nsIURI,
aChannel: *const nsIChannel,
_retval: *mut *const c_char
) -> nsresult
[src]
&self,
aURI: *const nsIURI,
aFirstURI: *const nsIURI,
aChannel: *const nsIChannel,
_retval: *mut *const c_char
) -> nsresult
string getCookieStringFromHttp (in nsIURI aURI, in nsIURI aFirstURI, in nsIChannel aChannel);
pub unsafe fn SetCookieString(
&self,
aURI: *const nsIURI,
aPrompt: *const nsIPrompt,
aCookie: *const c_char,
aChannel: *const nsIChannel
) -> nsresult
[src]
&self,
aURI: *const nsIURI,
aPrompt: *const nsIPrompt,
aCookie: *const c_char,
aChannel: *const nsIChannel
) -> nsresult
void setCookieString (in nsIURI aURI, in nsIPrompt aPrompt, in string aCookie, in nsIChannel aChannel);
pub unsafe fn SetCookieStringFromHttp(
&self,
aURI: *const nsIURI,
aFirstURI: *const nsIURI,
aPrompt: *const nsIPrompt,
aCookie: *const c_char,
aServerTime: *const c_char,
aChannel: *const nsIChannel
) -> nsresult
[src]
&self,
aURI: *const nsIURI,
aFirstURI: *const nsIURI,
aPrompt: *const nsIPrompt,
aCookie: *const c_char,
aServerTime: *const c_char,
aChannel: *const nsIChannel
) -> nsresult
void setCookieStringFromHttp (in nsIURI aURI, in nsIURI aFirstURI, in nsIPrompt aPrompt, in string aCookie, in string aServerTime, in nsIChannel aChannel);
pub unsafe fn RunInTransaction(
&self,
aCallback: *const nsICookieTransactionCallback
) -> nsresult
[src]
&self,
aCallback: *const nsICookieTransactionCallback
) -> nsresult
void runInTransaction (in nsICookieTransactionCallback aCallback);
Methods from Deref<Target = nsISupports>
pub fn coerce<T: nsISupportsCoerce>(&self) -> &T
[src]
Cast this nsISupports
to one of its base interfaces.
pub unsafe fn QueryInterface(
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
[src]
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);
pub unsafe fn AddRef(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt AddRef ();
pub unsafe fn Release(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt Release ();
Trait Implementations
impl XpCom for nsICookieService
[src]
const IID: nsIID
IID: nsIID = nsID(513073795, 10257, 20291, [185, 71, 210, 43, 21, 73, 216, 36])
fn query_interface<T: XpCom>(&self) -> Option<RefPtr<T>>
[src]
Perform a QueryInterface call on this object, attempting to dynamically cast it to the requested interface type. Returns Some(RefPtr) if the cast succeeded, and None otherwise. Read more
impl RefCounted for nsICookieService
[src]
unsafe fn addref(&self)
[src]
Increment the reference count.
unsafe fn release(&self)
[src]
Decrement the reference count, potentially freeing backing memory.
impl Deref for nsICookieService
[src]
type Target = nsISupports
The resulting type after dereferencing.
fn deref(&self) -> &nsISupports
[src]
Dereferences the value.