content/base/public/nsIAttribute.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 /* 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 #ifndef nsIAttribute_h___
     7 #define nsIAttribute_h___
     9 #include "nsINode.h"
    11 class nsDOMAttributeMap;
    12 class nsIContent;
    14 #define NS_IATTRIBUTE_IID  \
    15 { 0x233a9c4d, 0xb27f, 0x4662, \
    16     { 0xbd, 0x90, 0xba, 0xd6, 0x2e, 0x76, 0xc8, 0xe1 } }
    18 class nsIAttribute : public nsINode
    19 {
    20 public:
    21   NS_DECLARE_STATIC_IID_ACCESSOR(NS_IATTRIBUTE_IID)
    23   virtual void SetMap(nsDOMAttributeMap *aMap) = 0;
    25   nsDOMAttributeMap *GetMap()
    26   {
    27     return mAttrMap;
    28   }
    30   nsINodeInfo *NodeInfo() const
    31   {
    32     return mNodeInfo;
    33   }
    35   /**
    36    * Called when our ownerElement is moved into a new document.
    37    * Updates the nodeinfo of this node.
    38    */
    39   virtual nsresult SetOwnerDocument(nsIDocument* aDocument) = 0;
    41 protected:
    42 #ifdef MOZILLA_INTERNAL_API
    43   nsIAttribute(nsDOMAttributeMap *aAttrMap,
    44                already_AddRefed<nsINodeInfo>& aNodeInfo,
    45                bool aNsAware);
    46 #endif //MOZILLA_INTERNAL_API
    47   virtual ~nsIAttribute();
    49   nsRefPtr<nsDOMAttributeMap> mAttrMap;
    50   bool mNsAware;
    51 };
    53 NS_DEFINE_STATIC_IID_ACCESSOR(nsIAttribute, NS_IATTRIBUTE_IID)
    55 #endif /* nsIAttribute_h___ */

mercurial