Bug 1729952 [wpt PR 30477] - Fix timeout in grid-positioned-item-dynamic-change-006...
[gecko.git] / netwerk / base / nsIContentSniffer.idl
blobf9052b8e606b8c9f9b9cb7ab211e321d93d965f0
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.
13 [scriptable, uuid(a5772d1b-fc63-495e-a169-96e8d3311af0)]
14 interface nsIContentSniffer : nsISupports
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.
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
24 * @return The content type
26 * @throw NS_ERROR_NOT_AVAILABLE if no MIME type could be determined.
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.
32 ACString getMIMETypeFromContent(in nsIRequest aRequest,
33 [const,array,size_is(aLength)] in octet aData,
34 in unsigned long aLength);