layout/xul/nsPopupSetFrame.h

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

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  *
     3  * This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 #ifndef nsPopupSetFrame_h__
     8 #define nsPopupSetFrame_h__
    10 #include "mozilla/Attributes.h"
    11 #include "nsIAtom.h"
    12 #include "nsBoxFrame.h"
    14 nsIFrame* NS_NewPopupSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
    16 class nsPopupSetFrame : public nsBoxFrame
    17 {
    18 public:
    19   NS_DECL_FRAMEARENA_HELPERS
    21   nsPopupSetFrame(nsIPresShell* aShell, nsStyleContext* aContext):
    22     nsBoxFrame(aShell, aContext) {}
    24   ~nsPopupSetFrame() {}
    26   virtual void Init(nsIContent*      aContent,
    27                     nsIFrame*        aParent,
    28                     nsIFrame*        aPrevInFlow) MOZ_OVERRIDE;
    29   virtual nsresult AppendFrames(ChildListID     aListID,
    30                                 nsFrameList&    aFrameList) MOZ_OVERRIDE;
    31   virtual nsresult RemoveFrame(ChildListID     aListID,
    32                                nsIFrame*       aOldFrame) MOZ_OVERRIDE;
    33   virtual nsresult InsertFrames(ChildListID     aListID,
    34                                 nsIFrame*       aPrevFrame,
    35                                 nsFrameList&    aFrameList) MOZ_OVERRIDE;
    36   virtual nsresult  SetInitialChildList(ChildListID  aListID,
    37                                         nsFrameList& aChildList) MOZ_OVERRIDE;
    39   virtual const nsFrameList& GetChildList(ChildListID aList) const MOZ_OVERRIDE;
    40   virtual void GetChildLists(nsTArray<ChildList>* aLists) const MOZ_OVERRIDE;
    42   NS_IMETHOD DoLayout(nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE;
    44   // Used to destroy our popup frames.
    45   virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
    47   virtual nsIAtom* GetType() const MOZ_OVERRIDE;
    49 #ifdef DEBUG_FRAME_DUMP
    50   virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE
    51   {
    52       return MakeFrameName(NS_LITERAL_STRING("PopupSet"), aResult);
    53   }
    54 #endif
    56 protected:
    57   void AddPopupFrameList(nsFrameList& aPopupFrameList);
    58   void RemovePopupFrame(nsIFrame* aPopup);
    60   nsFrameList mPopupList;
    61 };
    63 #endif

mercurial