Interface nsIContentSnifferType

Content sniffer interface. Components implementing this interface can determine a MIME type from a chunk of bytes.

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

  • Given a chunk of data, determines a MIME type. Information from the given request may be used in order to make a better decision.

    Returns

    The content type

    Throw

    NS_ERROR_NOT_AVAILABLE if no MIME type could be determined.

    Note

    Implementations should consider the request read-only. Especially, they should not attempt to set the content type property that subclasses of nsIRequest might offer.

    Parameters

    • aRequest: nsIRequest

      The request where this data came from. May be null.

    • aData: number

      Data to check

    • aLength: number

      Length of the data

    Returns string

Generated using TypeDoc