content/base/src/nsScriptElement.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 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #ifndef nsScriptElement_h
     6 #define nsScriptElement_h
     8 #include "mozilla/Attributes.h"
     9 #include "nsIScriptLoaderObserver.h"
    10 #include "nsIScriptElement.h"
    11 #include "nsStubMutationObserver.h"
    13 /**
    14  * Baseclass useful for script elements (such as <xhtml:script> and
    15  * <svg:script>). Currently the class assumes that only the 'src'
    16  * attribute and the children of the class affect what script to execute.
    17  */
    19 class nsScriptElement : public nsIScriptElement,
    20                         public nsStubMutationObserver
    21 {
    22 public:
    23   // nsIScriptLoaderObserver
    24   NS_DECL_NSISCRIPTLOADEROBSERVER
    26   // nsIMutationObserver
    27   NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED
    28   NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED
    29   NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
    30   NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
    32   nsScriptElement(mozilla::dom::FromParser aFromParser)
    33     : nsIScriptElement(aFromParser)
    34   {
    35   }
    37   virtual nsresult FireErrorEvent() MOZ_OVERRIDE;
    39 protected:
    40   // Internal methods
    42   /**
    43    * Check if this element contains any script, linked or inline
    44    */
    45   virtual bool HasScriptContent() = 0;
    47   virtual bool MaybeProcessScript() MOZ_OVERRIDE;
    48 };
    50 #endif // nsScriptElement_h

mercurial