Bug 1804798 - Explicitly set auto page name (and corresponding debug flag) when inser...
[gecko.git] / netwerk / base / nsIAsyncStreamCopier.idl
blob633fe72b6e8436aabad3b3bea24327ed3fca0df0
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 "nsIRequest.idl"
7 interface nsIInputStream;
8 interface nsIOutputStream;
9 interface nsIRequestObserver;
10 interface nsIEventTarget;
12 // You should prefer nsIAsyncStreamCopier2
13 [scriptable, uuid(5a19ca27-e041-4aca-8287-eb248d4c50c0)]
14 interface nsIAsyncStreamCopier : nsIRequest
16 /**
17 * Initialize the stream copier.
19 * @param aSource
20 * contains the data to be copied.
21 * @param aSink
22 * specifies the destination for the data.
23 * @param aTarget
24 * specifies the thread on which the copy will occur. a null value
25 * is permitted and will cause the copy to occur on an unspecified
26 * background thread.
27 * @param aSourceBuffered
28 * true if aSource implements ReadSegments.
29 * @param aSinkBuffered
30 * true if aSink implements WriteSegments.
31 * @param aChunkSize
32 * specifies how many bytes to read/write at a time. this controls
33 * the granularity of the copying. it should match the segment size
34 * of the "buffered" streams involved.
35 * @param aCloseSource
36 * true if aSource should be closed after copying.
37 * @param aCloseSink
38 * true if aSink should be closed after copying.
40 * NOTE: at least one of the streams must be buffered. If you do not know
41 * whether your streams are buffered, you should use nsIAsyncStreamCopier2
42 * instead.
44 void init(in nsIInputStream aSource,
45 in nsIOutputStream aSink,
46 in nsIEventTarget aTarget,
47 in boolean aSourceBuffered,
48 in boolean aSinkBuffered,
49 in unsigned long aChunkSize,
50 in boolean aCloseSource,
51 in boolean aCloseSink);
53 /**
54 * asyncCopy triggers the start of the copy. The observer will be notified
55 * when the copy completes.
57 * @param aObserver
58 * receives notifications.
59 * @param aObserverContext
60 * passed to observer methods.
62 void asyncCopy(in nsIRequestObserver aObserver,
63 in nsISupports aObserverContext);