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: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
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 | #ifndef nsIContentSerializer_h |
michael@0 | 7 | #define nsIContentSerializer_h |
michael@0 | 8 | |
michael@0 | 9 | #include "nsISupports.h" |
michael@0 | 10 | |
michael@0 | 11 | class nsIContent; |
michael@0 | 12 | class nsIDocument; |
michael@0 | 13 | class nsAString; |
michael@0 | 14 | |
michael@0 | 15 | namespace mozilla { |
michael@0 | 16 | namespace dom { |
michael@0 | 17 | class Element; |
michael@0 | 18 | } // namespace dom |
michael@0 | 19 | } // namespace mozilla |
michael@0 | 20 | |
michael@0 | 21 | #define NS_ICONTENTSERIALIZER_IID \ |
michael@0 | 22 | { 0xb1ee32f2, 0xb8c4, 0x49b9, \ |
michael@0 | 23 | { 0x93, 0xdf, 0xb6, 0xfa, 0xb5, 0xd5, 0x46, 0x88 } } |
michael@0 | 24 | |
michael@0 | 25 | class nsIContentSerializer : public nsISupports { |
michael@0 | 26 | public: |
michael@0 | 27 | |
michael@0 | 28 | NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONTENTSERIALIZER_IID) |
michael@0 | 29 | |
michael@0 | 30 | NS_IMETHOD Init(uint32_t flags, uint32_t aWrapColumn, |
michael@0 | 31 | const char* aCharSet, bool aIsCopying, |
michael@0 | 32 | bool aIsWholeDocument) = 0; |
michael@0 | 33 | |
michael@0 | 34 | NS_IMETHOD AppendText(nsIContent* aText, int32_t aStartOffset, |
michael@0 | 35 | int32_t aEndOffset, nsAString& aStr) = 0; |
michael@0 | 36 | |
michael@0 | 37 | NS_IMETHOD AppendCDATASection(nsIContent* aCDATASection, |
michael@0 | 38 | int32_t aStartOffset, int32_t aEndOffset, |
michael@0 | 39 | nsAString& aStr) = 0; |
michael@0 | 40 | |
michael@0 | 41 | NS_IMETHOD AppendProcessingInstruction(nsIContent* aPI, |
michael@0 | 42 | int32_t aStartOffset, |
michael@0 | 43 | int32_t aEndOffset, |
michael@0 | 44 | nsAString& aStr) = 0; |
michael@0 | 45 | |
michael@0 | 46 | NS_IMETHOD AppendComment(nsIContent* aComment, int32_t aStartOffset, |
michael@0 | 47 | int32_t aEndOffset, nsAString& aStr) = 0; |
michael@0 | 48 | |
michael@0 | 49 | NS_IMETHOD AppendDoctype(nsIContent *aDoctype, |
michael@0 | 50 | nsAString& aStr) = 0; |
michael@0 | 51 | |
michael@0 | 52 | NS_IMETHOD AppendElementStart(mozilla::dom::Element* aElement, |
michael@0 | 53 | mozilla::dom::Element* aOriginalElement, |
michael@0 | 54 | nsAString& aStr) = 0; |
michael@0 | 55 | |
michael@0 | 56 | NS_IMETHOD AppendElementEnd(mozilla::dom::Element* aElement, |
michael@0 | 57 | nsAString& aStr) = 0; |
michael@0 | 58 | |
michael@0 | 59 | NS_IMETHOD Flush(nsAString& aStr) = 0; |
michael@0 | 60 | |
michael@0 | 61 | /** |
michael@0 | 62 | * Append any items in the beginning of the document that won't be |
michael@0 | 63 | * serialized by other methods. XML declaration is the most likely |
michael@0 | 64 | * thing this method can produce. |
michael@0 | 65 | */ |
michael@0 | 66 | NS_IMETHOD AppendDocumentStart(nsIDocument *aDocument, |
michael@0 | 67 | nsAString& aStr) = 0; |
michael@0 | 68 | }; |
michael@0 | 69 | |
michael@0 | 70 | NS_DEFINE_STATIC_IID_ACCESSOR(nsIContentSerializer, NS_ICONTENTSERIALIZER_IID) |
michael@0 | 71 | |
michael@0 | 72 | #define NS_CONTENTSERIALIZER_CONTRACTID_PREFIX \ |
michael@0 | 73 | "@mozilla.org/layout/contentserializer;1?mimetype=" |
michael@0 | 74 | |
michael@0 | 75 | #endif /* nsIContentSerializer_h */ |