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 | #ifndef nsSelectsAreaFrame_h___ |
michael@0 | 6 | #define nsSelectsAreaFrame_h___ |
michael@0 | 7 | |
michael@0 | 8 | #include "mozilla/Attributes.h" |
michael@0 | 9 | #include "nsBlockFrame.h" |
michael@0 | 10 | |
michael@0 | 11 | class nsSelectsAreaFrame : public nsBlockFrame |
michael@0 | 12 | { |
michael@0 | 13 | public: |
michael@0 | 14 | NS_DECL_FRAMEARENA_HELPERS |
michael@0 | 15 | |
michael@0 | 16 | friend nsIFrame* NS_NewSelectsAreaFrame(nsIPresShell* aShell, nsStyleContext* aContext, nsFrameState aFlags); |
michael@0 | 17 | |
michael@0 | 18 | virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder, |
michael@0 | 19 | const nsRect& aDirtyRect, |
michael@0 | 20 | const nsDisplayListSet& aLists) MOZ_OVERRIDE; |
michael@0 | 21 | |
michael@0 | 22 | void BuildDisplayListInternal(nsDisplayListBuilder* aBuilder, |
michael@0 | 23 | const nsRect& aDirtyRect, |
michael@0 | 24 | const nsDisplayListSet& aLists); |
michael@0 | 25 | |
michael@0 | 26 | virtual nsresult Reflow(nsPresContext* aCX, |
michael@0 | 27 | nsHTMLReflowMetrics& aDesiredSize, |
michael@0 | 28 | const nsHTMLReflowState& aReflowState, |
michael@0 | 29 | nsReflowStatus& aStatus) MOZ_OVERRIDE; |
michael@0 | 30 | |
michael@0 | 31 | nscoord HeightOfARow() const { return mHeightOfARow; } |
michael@0 | 32 | |
michael@0 | 33 | protected: |
michael@0 | 34 | nsSelectsAreaFrame(nsStyleContext* aContext) : |
michael@0 | 35 | nsBlockFrame(aContext), |
michael@0 | 36 | mHeightOfARow(0) |
michael@0 | 37 | {} |
michael@0 | 38 | |
michael@0 | 39 | // We cache the height of a single row so that changes to the "size" |
michael@0 | 40 | // attribute, padding, etc. can all be handled with only one reflow. We'll |
michael@0 | 41 | // have to reflow twice if someone changes our font size or something like |
michael@0 | 42 | // that, so that the heights of our options will change. |
michael@0 | 43 | nscoord mHeightOfARow; |
michael@0 | 44 | }; |
michael@0 | 45 | |
michael@0 | 46 | #endif /* nsSelectsAreaFrame_h___ */ |