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 /* class for CSS @namespace rules */
8 #ifndef mozilla_css_NameSpaceRule_h__
9 #define mozilla_css_NameSpaceRule_h__
11 #include "mozilla/Attributes.h"
12 #include "mozilla/MemoryReporting.h"
13 #include "mozilla/css/Rule.h"
15 #include "nsIDOMCSSRule.h"
17 class nsIAtom;
19 // IID for the NameSpaceRule class {f0b0dbe1-5031-4a21-b06a-dc141ef2af98}
20 #define NS_CSS_NAMESPACE_RULE_IMPL_CID \
21 {0xf0b0dbe1, 0x5031, 0x4a21, {0xb0, 0x6a, 0xdc, 0x14, 0x1e, 0xf2, 0xaf, 0x98}}
24 namespace mozilla {
25 namespace css {
27 class NameSpaceRule MOZ_FINAL : public Rule,
28 public nsIDOMCSSRule
29 {
30 public:
31 NameSpaceRule(nsIAtom* aPrefix, const nsString& aURLSpec);
32 private:
33 // for |Clone|
34 NameSpaceRule(const NameSpaceRule& aCopy);
35 ~NameSpaceRule();
36 public:
37 NS_DECLARE_STATIC_IID_ACCESSOR(NS_CSS_NAMESPACE_RULE_IMPL_CID)
39 NS_DECL_ISUPPORTS
41 DECL_STYLE_RULE_INHERIT
43 // nsIStyleRule methods
44 #ifdef DEBUG
45 virtual void List(FILE* out = stdout, int32_t aIndent = 0) const MOZ_OVERRIDE;
46 #endif
48 // Rule methods
49 virtual int32_t GetType() const;
50 virtual already_AddRefed<Rule> Clone() const;
52 nsIAtom* GetPrefix() const { return mPrefix; }
54 void GetURLSpec(nsString& aURLSpec) const { aURLSpec = mURLSpec; }
56 virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
57 MOZ_MUST_OVERRIDE;
59 // nsIDOMCSSRule interface
60 NS_DECL_NSIDOMCSSRULE
62 private:
63 nsCOMPtr<nsIAtom> mPrefix;
64 nsString mURLSpec;
65 };
67 NS_DEFINE_STATIC_IID_ACCESSOR(NameSpaceRule, NS_CSS_NAMESPACE_RULE_IMPL_CID)
69 } // namespace css
70 } // namespace mozilla
72 #endif /* mozilla_css_NameSpaceRule_h__ */