image/public/imgILoader.idl

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
michael@0 2 *
michael@0 3 * This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 #include "nsISupports.idl"
michael@0 8
michael@0 9 interface imgINotificationObserver;
michael@0 10 interface imgIRequest;
michael@0 11
michael@0 12 interface nsIChannel;
michael@0 13 interface nsILoadGroup;
michael@0 14 interface nsIPrincipal;
michael@0 15 interface nsIStreamListener;
michael@0 16 interface nsIURI;
michael@0 17
michael@0 18 interface nsISimpleEnumerator;
michael@0 19 interface nsIChannelPolicy;
michael@0 20
michael@0 21 #include "nsIRequest.idl" // for nsLoadFlags
michael@0 22
michael@0 23 /**
michael@0 24 * imgILoader interface
michael@0 25 *
michael@0 26 * @author Stuart Parmenter <pavlov@netscape.com>
michael@0 27 * @version 0.3
michael@0 28 * @see imagelib2
michael@0 29 */
michael@0 30 [scriptable, builtinclass, uuid(c8126129-8dac-43cd-b1ba-3896fba2dd01)]
michael@0 31 interface imgILoader : nsISupports
michael@0 32 {
michael@0 33 // Extra flags to pass to loadImage if you want a load to use CORS
michael@0 34 // validation.
michael@0 35 const unsigned long LOAD_CORS_ANONYMOUS = 1 << 16;
michael@0 36 const unsigned long LOAD_CORS_USE_CREDENTIALS = 1 << 17;
michael@0 37
michael@0 38 /**
michael@0 39 * Start the load and decode of an image.
michael@0 40 * @param aURI the URI to load
michael@0 41 * @param aFirstPartyIsolationURI the urlbar URI that 'initiated' the load -- used for 3rd party blocking
michael@0 42 * @param aReferrerURI the 'referring' URI
michael@0 43 * @param aLoadingPrincipal the principal of the loading document
michael@0 44 * @param aLoadGroup Loadgroup to put the image load into
michael@0 45 * @param aObserver the observer (may be null)
michael@0 46 * @param aCX some random data
michael@0 47 * @param aLoadFlags Load flags for the request
michael@0 48 * @param aCacheKey cache key to use for a load if the original
michael@0 49 * image came from a request that had post data
michael@0 50
michael@0 51
michael@0 52 * libpr0n does NOT keep a strong ref to the observer; this prevents
michael@0 53 * reference cycles. This means that callers of loadImage should
michael@0 54 * make sure to Cancel() the resulting request before the observer
michael@0 55 * goes away.
michael@0 56 */
michael@0 57 imgIRequest loadImageXPCOM(in nsIURI aURI,
michael@0 58 in nsIURI aFirstPartyIsolationURI,
michael@0 59 in nsIURI aReferrerURI,
michael@0 60 in nsIPrincipal aLoadingPrincipal,
michael@0 61 in nsILoadGroup aLoadGroup,
michael@0 62 in imgINotificationObserver aObserver,
michael@0 63 in nsISupports aCX,
michael@0 64 in nsLoadFlags aLoadFlags,
michael@0 65 in nsISupports cacheKey,
michael@0 66 in nsIChannelPolicy channelPolicy);
michael@0 67
michael@0 68 /**
michael@0 69 * Start the load and decode of an image.
michael@0 70 * @param aChannel the channel to load the image from. This must
michael@0 71 * already be opened before ths method is called, and there
michael@0 72 * must have been no OnDataAvailable calls for it yet.
michael@0 73 * @param aObserver the observer (may be null)
michael@0 74 * @param cx some random data
michael@0 75 * @param aListener [out]
michael@0 76 * A listener that you must send the channel's notifications and data to.
michael@0 77 * Can be null, in which case imagelib has found a cached image and is
michael@0 78 * not interested in the data. @aChannel will be canceled for you in
michael@0 79 * this case.
michael@0 80 *
michael@0 81 * libpr0n does NOT keep a strong ref to the observer; this prevents
michael@0 82 * reference cycles. This means that callers of loadImageWithChannel should
michael@0 83 * make sure to Cancel() the resulting request before the observer goes away.
michael@0 84 */
michael@0 85 imgIRequest loadImageWithChannelXPCOM(in nsIChannel aChannel,
michael@0 86 in imgINotificationObserver aObserver,
michael@0 87 in nsISupports cx,
michael@0 88 out nsIStreamListener aListener);
michael@0 89 };

mercurial