Tue, 06 Jan 2015 21:39:09 +0100
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.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #include "nsIInputStream.idl" |
michael@0 | 7 | |
michael@0 | 8 | /** |
michael@0 | 9 | * The multiplex stream concatenates a list of input streams into a single |
michael@0 | 10 | * stream. |
michael@0 | 11 | */ |
michael@0 | 12 | |
michael@0 | 13 | [scriptable, uuid(a076fd12-1dd1-11b2-b19a-d53b5dffaade)] |
michael@0 | 14 | interface nsIMultiplexInputStream : nsIInputStream |
michael@0 | 15 | { |
michael@0 | 16 | /** |
michael@0 | 17 | * Number of streams in this multiplex-stream |
michael@0 | 18 | */ |
michael@0 | 19 | readonly attribute unsigned long count; |
michael@0 | 20 | |
michael@0 | 21 | /** |
michael@0 | 22 | * Appends a stream to the end of the streams. The cursor of the stream |
michael@0 | 23 | * should be located at the beginning of the stream if the implementation |
michael@0 | 24 | * of this nsIMultiplexInputStream also is used as an nsISeekableStream. |
michael@0 | 25 | * @param stream stream to append |
michael@0 | 26 | */ |
michael@0 | 27 | void appendStream(in nsIInputStream stream); |
michael@0 | 28 | |
michael@0 | 29 | /** |
michael@0 | 30 | * Insert a stream at specified index. If the cursor of this stream is at |
michael@0 | 31 | * the beginning of the stream at index, the cursor will be placed at the |
michael@0 | 32 | * beginning of the inserted stream instead. |
michael@0 | 33 | * The cursor of the new stream should be located at the beginning of the |
michael@0 | 34 | * stream if the implementation of this nsIMultiplexInputStream also is |
michael@0 | 35 | * used as an nsISeekableStream. |
michael@0 | 36 | * @param stream stream to insert |
michael@0 | 37 | * @param index index to insert stream at, must be <= count |
michael@0 | 38 | */ |
michael@0 | 39 | void insertStream(in nsIInputStream stream, in unsigned long index); |
michael@0 | 40 | |
michael@0 | 41 | /** |
michael@0 | 42 | * Remove stream at specified index. If this stream is the one currently |
michael@0 | 43 | * being read the readcursor is moved to the beginning of the next |
michael@0 | 44 | * stream |
michael@0 | 45 | * @param index remove stream at this index, must be < count |
michael@0 | 46 | */ |
michael@0 | 47 | void removeStream(in unsigned long index); |
michael@0 | 48 | |
michael@0 | 49 | /** |
michael@0 | 50 | * Get stream at specified index. |
michael@0 | 51 | * @param index return stream at this index, must be < count |
michael@0 | 52 | * @return stream at specified index |
michael@0 | 53 | */ |
michael@0 | 54 | nsIInputStream getStream(in unsigned long index); |
michael@0 | 55 | }; |