netwerk/protocol/file/nsFileChannel.h

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
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: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* vim:set ts=2 sw=2 sts=2 et cin: */
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 #ifndef nsFileChannel_h__
michael@0 8 #define nsFileChannel_h__
michael@0 9
michael@0 10 #include "nsBaseChannel.h"
michael@0 11 #include "nsIFileChannel.h"
michael@0 12 #include "nsIUploadChannel.h"
michael@0 13
michael@0 14 class nsFileChannel : public nsBaseChannel
michael@0 15 , public nsIFileChannel
michael@0 16 , public nsIUploadChannel
michael@0 17 {
michael@0 18 public:
michael@0 19 NS_DECL_ISUPPORTS_INHERITED
michael@0 20 NS_DECL_NSIFILECHANNEL
michael@0 21 NS_DECL_NSIUPLOADCHANNEL
michael@0 22
michael@0 23 nsFileChannel(nsIURI *uri);
michael@0 24
michael@0 25 protected:
michael@0 26 // Called to construct a blocking file input stream for the given file. This
michael@0 27 // method also returns a best guess at the content-type for the data stream.
michael@0 28 // NOTE: If the channel has a type hint set, contentType will be left
michael@0 29 // untouched. The caller should not use it in that case.
michael@0 30 nsresult MakeFileInputStream(nsIFile *file, nsCOMPtr<nsIInputStream> &stream,
michael@0 31 nsCString &contentType, bool async);
michael@0 32
michael@0 33 virtual nsresult OpenContentStream(bool async, nsIInputStream **result,
michael@0 34 nsIChannel** channel);
michael@0 35
michael@0 36 private:
michael@0 37 nsCOMPtr<nsIInputStream> mUploadStream;
michael@0 38 int64_t mUploadLength;
michael@0 39 };
michael@0 40
michael@0 41 #endif // !nsFileChannel_h__

mercurial