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.

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

mercurial