xpcom/io/nsISeekableStream.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 /* -*- 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
michael@0 7 /*
michael@0 8 * nsISeekableStream
michael@0 9 *
michael@0 10 * Note that a stream might not implement all methods (e.g., a readonly stream
michael@0 11 * won't implement setEOF)
michael@0 12 */
michael@0 13
michael@0 14 #include "nsISupports.idl"
michael@0 15
michael@0 16 [scriptable, uuid(8429d350-1040-4661-8b71-f2a6ba455980)]
michael@0 17 interface nsISeekableStream : nsISupports
michael@0 18 {
michael@0 19 /*
michael@0 20 * Sets the stream pointer to the value of the 'offset' parameter
michael@0 21 */
michael@0 22 const int32_t NS_SEEK_SET = 0;
michael@0 23
michael@0 24 /*
michael@0 25 * Sets the stream pointer to its current location plus the value
michael@0 26 * of the offset parameter.
michael@0 27 */
michael@0 28 const int32_t NS_SEEK_CUR = 1;
michael@0 29
michael@0 30 /*
michael@0 31 * Sets the stream pointer to the size of the stream plus the value
michael@0 32 * of the offset parameter.
michael@0 33 */
michael@0 34 const int32_t NS_SEEK_END = 2;
michael@0 35
michael@0 36 /**
michael@0 37 * seek
michael@0 38 *
michael@0 39 * This method moves the stream offset of the steam implementing this
michael@0 40 * interface.
michael@0 41 *
michael@0 42 * @param whence specifies how to interpret the 'offset' parameter in
michael@0 43 * setting the stream offset associated with the implementing
michael@0 44 * stream.
michael@0 45 *
michael@0 46 * @param offset specifies a value, in bytes, that is used in conjunction
michael@0 47 * with the 'whence' parameter to set the stream offset of the
michael@0 48 * implementing stream. A negative value causes seeking in
michael@0 49 * the reverse direction.
michael@0 50 *
michael@0 51 * @throws NS_BASE_STREAM_CLOSED if called on a closed stream.
michael@0 52 */
michael@0 53 void seek(in long whence, in long long offset);
michael@0 54
michael@0 55 /**
michael@0 56 * tell
michael@0 57 *
michael@0 58 * This method reports the current offset, in bytes, from the start of the
michael@0 59 * stream.
michael@0 60 *
michael@0 61 * @throws NS_BASE_STREAM_CLOSED if called on a closed stream.
michael@0 62 */
michael@0 63 long long tell();
michael@0 64
michael@0 65
michael@0 66 /**
michael@0 67 * setEOF
michael@0 68 *
michael@0 69 * This method truncates the stream at the current offset.
michael@0 70 *
michael@0 71 * @throws NS_BASE_STREAM_CLOSED if called on a closed stream.
michael@0 72 */
michael@0 73 void setEOF();
michael@0 74 };

mercurial