netwerk/base/public/nsIContentSniffer.idl

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     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