netwerk/base/public/nsIContentSniffer.idl

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #include "nsISupports.idl"
     7 interface nsIRequest;
     9 /**
    10  * Content sniffer interface. Components implementing this interface can
    11  * determine a MIME type from a chunk of bytes.
    12  */
    13 [scriptable, uuid(a5772d1b-fc63-495e-a169-96e8d3311af0)]
    14 interface nsIContentSniffer : nsISupports
    15 {
    16   /**
    17    * Given a chunk of data, determines a MIME type. Information from the given
    18    * request may be used in order to make a better decision.
    19    *
    20    * @param aRequest The request where this data came from. May be null.
    21    * @param aData Data to check
    22    * @param aLength Length of the data
    23    *
    24    * @return The content type
    25    *
    26    * @throw NS_ERROR_NOT_AVAILABLE if no MIME type could be determined.
    27    *
    28    * @note Implementations should consider the request read-only. Especially,
    29    * they should not attempt to set the content type property that subclasses of
    30    * nsIRequest might offer.
    31    */
    32   ACString getMIMETypeFromContent(in nsIRequest aRequest,
    33                                   [const,array,size_is(aLength)] in octet aData,
    34                                   in unsigned long aLength);
    35 };

mercurial