Interface nsIClearDataServiceType

nsIClearDataService

Provides methods for cleaning data from a nsIPrincipal and/or from a time range.

Hierarchy

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Some cleaners, namely QuotaCleaner, can opt in and treat things as deleted without actually removing files at shutdown. This function will trigger actual removal of them.

    Parameters

    • aFlags: uint32_t
    • aCallback: nsIClearDataCallback

    Returns void

  • Delete all data from any host, in any time range.

    Parameters

    • aFlags: uint32_t

      List of flags. See below the accepted values.

    • aCallback: nsIClearDataCallback

      ths callback will be executed when the operation is completed.

    Returns void

  • Delete data owned by or partitioned under a baseDomain (eTLD+1). For instance: mozilla.org. Deletes data across all origin attributes. For partitioned storage we clear both, data of the baseDomain in 1st-party and 3rd-party context. When handling user requests for clearing data using this method is preferred over deleteDataFromPrincipal, since origins may share information with their site (e.g. cookies) that are not deleted by principal.

    Throws

    Throws if base domain can't be computed from aDomainOrHost. Callers may fall back to clearing by principal or host.

    Parameters

    • aDomainOrHost: string

      the domain or host to be used. Will be converted to baseDomain if needed.

    • aIsUserRequest: bool

      true if this request comes from a user interaction. This information is important because if true, it's probably better to remove more than less, for privacy reason. If false (e.g. Clear-Site-Data header), we don't want to delete more than what is strictly required.

    • aFlags: uint32_t

      List of flags. See below the accepted values.

    • aCallback: nsIClearDataCallback

      this callback will be executed when the operation is completed.

    Returns void

  • Delete data owned by a host. For instance: mozilla.org. Data from any possible originAttributes will be deleted.

    Deprecated

    Use deleteDataFromBaseDomain instead.

    Parameters

    • aHost: string

      the host to be used.

    • aIsUserRequest: bool

      true if this request comes from a user interaction. This information is important because if true, it's probably better to remove more than less, for privacy reason. If false (e.g. Clear-Site-Data header), we don't want to delete more than what is strictly required.

    • aFlags: uint32_t

      List of flags. See below the accepted values.

    • aCallback: nsIClearDataCallback

      this callback will be executed when the operation is completed.

    Returns void

  • Delete data owned by local files or other hostless schemes.

    Parameters

    • aIsUserRequest: bool

      true if this request comes from a user interaction. This information is important because if true, it's probably better to remove more than less, for privacy reason. If false (e.g. Clear-Site-Data header), we don't want to delete more than what is strictly required.

    • aFlags: uint32_t

      List of flags. See below the accepted values. Note that not all flags will make sense (e.g. we can't clear certificates for local files). Nonsensical flags will be ignored.

    • aCallback: nsIClearDataCallback

      this callback will be executed when the operation is completed.

    Returns void

  • Delete all data from an OriginAttributesPatternDictionary.

    Parameters

    • aOriginAttributesPattern: any

      the originAttributes dictionary.

    • aCallback: nsIClearDataCallback

      the optional callback will be executed when the operation is completed.

    Returns void

  • Delete data owned by a principal.

    Parameters

    • aPrincipal: nsIPrincipal

      the nsIPrincipal to be used.

    • aIsUserRequest: bool

      true if this request comes from a user interaction. This information is important because if true, it's probably better to remove more than less, for privacy reason. If false (e.g. Clear-Site-Data header), we don't want to delete more than what is strictly required.

    • aFlags: uint32_t

      List of flags. See below the accepted values.

    • aCallback: nsIClearDataCallback

      ths callback will be executed when the operation is completed.

    Returns void

  • Delete all data in a time range. Limit excluded.

    Parameters

    • aFrom: number

      microseconds from the epoch

    • aTo: number

      microseconds from the epoch

    • aIsUserRequest: bool

      true if this request comes from a user interaction. This information is important because if true, it's probably better to remove more than less, for privacy reason. If false (e.g. Clear-Site-Data header), we don't want to delete more than what is strictly required.

    • aFlags: uint32_t

      List of flags. See below the accepted values.

    • aCallback: nsIClearDataCallback

      ths callback will be executed when the operation is completed.

    Returns void

  • This is a helper function to clear storageAccessAPI permissions in a way that will not result in users getting logged out by cookie purging. To that end we only clear permissions for principals whose base domain does not have any storage associated with it.

    The principals to be considered will need to be passed by the API consumer. It is recommended to use PrincipalsCollector.jsm for that.

    Parameters

    • aPrincipalsWithStorage: invalid

      principals to be excluded from clearing

    • aFrom: number

      microseconds from the epoch

    • aCallback: nsIClearDataCallback

      the optional callback will be executed when the operation is completed.

    Returns void

Generated using TypeDoc