xpcom/io/nsIConverterOutputStream.idl

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

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 /* vim:set expandtab ts=4 sw=4 sts=4 cin: */
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 "nsIUnicharOutputStream.idl"
michael@0 7
michael@0 8 interface nsIOutputStream;
michael@0 9
michael@0 10 /**
michael@0 11 * This interface allows writing strings to a stream, doing automatic
michael@0 12 * character encoding conversion.
michael@0 13 */
michael@0 14 [scriptable, uuid(4b71113a-cb0d-479f-8ed5-01daeba2e8d4)]
michael@0 15 interface nsIConverterOutputStream : nsIUnicharOutputStream
michael@0 16 {
michael@0 17 /**
michael@0 18 * Initialize this stream. Must be called before any other method on this
michael@0 19 * interface, or you will crash. The output stream passed to this method
michael@0 20 * must not be null, or you will crash.
michael@0 21 *
michael@0 22 * @param aOutStream
michael@0 23 * The underlying output stream to which the converted strings will
michael@0 24 * be written.
michael@0 25 * @param aCharset
michael@0 26 * The character set to use for encoding the characters. A null
michael@0 27 * charset will be interpreted as UTF-8.
michael@0 28 * @param aBufferSize
michael@0 29 * How many bytes to buffer. A value of 0 means that no bytes will be
michael@0 30 * buffered. Implementations not supporting buffering may ignore
michael@0 31 * this parameter.
michael@0 32 * @param aReplacementCharacter
michael@0 33 * The replacement character to use when an unsupported character is found.
michael@0 34 * The character must be encodable in the selected character
michael@0 35 * encoding; otherwise, attempts to write an unsupported character
michael@0 36 * will throw NS_ERROR_LOSS_OF_SIGNIFICANT_DATA.
michael@0 37 *
michael@0 38 * A value of 0x0000 will cause an exception to be thrown upon
michael@0 39 * attempts to write unsupported characters.
michael@0 40 */
michael@0 41 void init(in nsIOutputStream aOutStream, in string aCharset,
michael@0 42 in unsigned long aBufferSize,
michael@0 43 in char16_t aReplacementCharacter);
michael@0 44 };

mercurial