layout/style/ImportRule.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 /* class for CSS @import rules */
     8 #ifndef mozilla_css_ImportRule_h__
     9 #define mozilla_css_ImportRule_h__
    11 #include "mozilla/Attributes.h"
    13 #include "mozilla/MemoryReporting.h"
    14 #include "mozilla/css/Rule.h"
    15 #include "nsIDOMCSSImportRule.h"
    16 #include "nsCSSRules.h"
    18 class nsMediaList;
    19 class nsString;
    21 namespace mozilla {
    22 namespace css {
    24 class ImportRule MOZ_FINAL : public Rule,
    25                              public nsIDOMCSSImportRule
    26 {
    27 public:
    28   ImportRule(nsMediaList* aMedia, const nsString& aURLSpec);
    29 private:
    30   // for |Clone|
    31   ImportRule(const ImportRule& aCopy);
    32   ~ImportRule();
    33 public:
    34   NS_DECL_ISUPPORTS
    36   DECL_STYLE_RULE_INHERIT
    38 #ifdef HAVE_CPP_AMBIGUITY_RESOLVING_USING
    39   using Rule::GetStyleSheet; // unhide since nsIDOMCSSImportRule has its own GetStyleSheet
    40 #endif
    42   // nsIStyleRule methods
    43 #ifdef DEBUG
    44   virtual void List(FILE* out = stdout, int32_t aIndent = 0) const MOZ_OVERRIDE;
    45 #endif
    47   // Rule methods
    48   virtual int32_t GetType() const;
    49   virtual already_AddRefed<Rule> Clone() const;
    51   void SetSheet(nsCSSStyleSheet*);
    53   virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
    55   // nsIDOMCSSRule interface
    56   NS_DECL_NSIDOMCSSRULE
    58   // nsIDOMCSSImportRule interface
    59   NS_DECL_NSIDOMCSSIMPORTRULE
    61 private:
    62   nsString  mURLSpec;
    63   nsRefPtr<nsMediaList> mMedia;
    64   nsRefPtr<nsCSSStyleSheet> mChildSheet;
    65 };
    67 } // namespace css
    68 } // namespace mozilla
    70 #endif /* mozilla_css_ImportRule_h__ */

mercurial