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.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 /**
8 Author:
9 Eric D Vaughan
11 **/
13 #ifndef nsGridRowGroupLayout_h___
14 #define nsGridRowGroupLayout_h___
16 #include "mozilla/Attributes.h"
17 #include "nsGridRowLayout.h"
19 /**
20 * The nsBoxLayout implementation for nsGridRowGroupFrame.
21 */
22 class nsGridRowGroupLayout : public nsGridRowLayout
23 {
24 public:
26 friend already_AddRefed<nsBoxLayout> NS_NewGridRowGroupLayout();
28 virtual nsGridRowGroupLayout* CastToRowGroupLayout() MOZ_OVERRIDE { return this; }
29 virtual nsSize GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE;
30 virtual nsSize GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE;
31 virtual nsSize GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE;
32 virtual void CountRowsColumns(nsIFrame* aBox, int32_t& aRowCount, int32_t& aComputedColumnCount) MOZ_OVERRIDE;
33 virtual void DirtyRows(nsIFrame* aBox, nsBoxLayoutState& aState) MOZ_OVERRIDE;
34 virtual int32_t BuildRows(nsIFrame* aBox, nsGridRow* aRows) MOZ_OVERRIDE;
35 virtual nsMargin GetTotalMargin(nsIFrame* aBox, bool aIsHorizontal) MOZ_OVERRIDE;
36 virtual int32_t GetRowCount() MOZ_OVERRIDE { return mRowCount; }
37 virtual Type GetType() MOZ_OVERRIDE { return eRowGroup; }
39 protected:
40 nsGridRowGroupLayout();
41 virtual ~nsGridRowGroupLayout();
43 virtual void ChildAddedOrRemoved(nsIFrame* aBox, nsBoxLayoutState& aState) MOZ_OVERRIDE;
44 static void AddWidth(nsSize& aSize, nscoord aSize2, bool aIsHorizontal);
46 private:
47 int32_t mRowCount;
48 };
50 #endif