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 | * |
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 nsPopupSetFrame_h__ |
michael@0 | 8 | #define nsPopupSetFrame_h__ |
michael@0 | 9 | |
michael@0 | 10 | #include "mozilla/Attributes.h" |
michael@0 | 11 | #include "nsIAtom.h" |
michael@0 | 12 | #include "nsBoxFrame.h" |
michael@0 | 13 | |
michael@0 | 14 | nsIFrame* NS_NewPopupSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); |
michael@0 | 15 | |
michael@0 | 16 | class nsPopupSetFrame : public nsBoxFrame |
michael@0 | 17 | { |
michael@0 | 18 | public: |
michael@0 | 19 | NS_DECL_FRAMEARENA_HELPERS |
michael@0 | 20 | |
michael@0 | 21 | nsPopupSetFrame(nsIPresShell* aShell, nsStyleContext* aContext): |
michael@0 | 22 | nsBoxFrame(aShell, aContext) {} |
michael@0 | 23 | |
michael@0 | 24 | ~nsPopupSetFrame() {} |
michael@0 | 25 | |
michael@0 | 26 | virtual void Init(nsIContent* aContent, |
michael@0 | 27 | nsIFrame* aParent, |
michael@0 | 28 | nsIFrame* aPrevInFlow) MOZ_OVERRIDE; |
michael@0 | 29 | virtual nsresult AppendFrames(ChildListID aListID, |
michael@0 | 30 | nsFrameList& aFrameList) MOZ_OVERRIDE; |
michael@0 | 31 | virtual nsresult RemoveFrame(ChildListID aListID, |
michael@0 | 32 | nsIFrame* aOldFrame) MOZ_OVERRIDE; |
michael@0 | 33 | virtual nsresult InsertFrames(ChildListID aListID, |
michael@0 | 34 | nsIFrame* aPrevFrame, |
michael@0 | 35 | nsFrameList& aFrameList) MOZ_OVERRIDE; |
michael@0 | 36 | virtual nsresult SetInitialChildList(ChildListID aListID, |
michael@0 | 37 | nsFrameList& aChildList) MOZ_OVERRIDE; |
michael@0 | 38 | |
michael@0 | 39 | virtual const nsFrameList& GetChildList(ChildListID aList) const MOZ_OVERRIDE; |
michael@0 | 40 | virtual void GetChildLists(nsTArray<ChildList>* aLists) const MOZ_OVERRIDE; |
michael@0 | 41 | |
michael@0 | 42 | NS_IMETHOD DoLayout(nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE; |
michael@0 | 43 | |
michael@0 | 44 | // Used to destroy our popup frames. |
michael@0 | 45 | virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE; |
michael@0 | 46 | |
michael@0 | 47 | virtual nsIAtom* GetType() const MOZ_OVERRIDE; |
michael@0 | 48 | |
michael@0 | 49 | #ifdef DEBUG_FRAME_DUMP |
michael@0 | 50 | virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE |
michael@0 | 51 | { |
michael@0 | 52 | return MakeFrameName(NS_LITERAL_STRING("PopupSet"), aResult); |
michael@0 | 53 | } |
michael@0 | 54 | #endif |
michael@0 | 55 | |
michael@0 | 56 | protected: |
michael@0 | 57 | void AddPopupFrameList(nsFrameList& aPopupFrameList); |
michael@0 | 58 | void RemovePopupFrame(nsIFrame* aPopup); |
michael@0 | 59 | |
michael@0 | 60 | nsFrameList mPopupList; |
michael@0 | 61 | }; |
michael@0 | 62 | |
michael@0 | 63 | #endif |