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.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef NS_SMILSETANIMATIONFUNCTION_H_ |
michael@0 | 7 | #define NS_SMILSETANIMATIONFUNCTION_H_ |
michael@0 | 8 | |
michael@0 | 9 | #include "mozilla/Attributes.h" |
michael@0 | 10 | #include "nsSMILAnimationFunction.h" |
michael@0 | 11 | |
michael@0 | 12 | //---------------------------------------------------------------------- |
michael@0 | 13 | // nsSMILSetAnimationFunction |
michael@0 | 14 | // |
michael@0 | 15 | // Subclass of nsSMILAnimationFunction that limits the behaviour to that offered |
michael@0 | 16 | // by a <set> element. |
michael@0 | 17 | // |
michael@0 | 18 | class nsSMILSetAnimationFunction : public nsSMILAnimationFunction |
michael@0 | 19 | { |
michael@0 | 20 | public: |
michael@0 | 21 | /* |
michael@0 | 22 | * Sets animation-specific attributes (or marks them dirty, in the case |
michael@0 | 23 | * of from/to/by/values). |
michael@0 | 24 | * |
michael@0 | 25 | * @param aAttribute The attribute being set |
michael@0 | 26 | * @param aValue The updated value of the attribute. |
michael@0 | 27 | * @param aResult The nsAttrValue object that may be used for storing the |
michael@0 | 28 | * parsed result. |
michael@0 | 29 | * @param aParseResult Outparam used for reporting parse errors. Will be set |
michael@0 | 30 | * to NS_OK if everything succeeds. |
michael@0 | 31 | * @returns true if aAttribute is a recognized animation-related |
michael@0 | 32 | * attribute; false otherwise. |
michael@0 | 33 | */ |
michael@0 | 34 | virtual bool SetAttr(nsIAtom* aAttribute, const nsAString& aValue, |
michael@0 | 35 | nsAttrValue& aResult, nsresult* aParseResult = nullptr) MOZ_OVERRIDE; |
michael@0 | 36 | |
michael@0 | 37 | /* |
michael@0 | 38 | * Unsets the given attribute. |
michael@0 | 39 | * |
michael@0 | 40 | * @returns true if aAttribute is a recognized animation-related |
michael@0 | 41 | * attribute; false otherwise. |
michael@0 | 42 | */ |
michael@0 | 43 | virtual bool UnsetAttr(nsIAtom* aAttribute) MOZ_OVERRIDE; |
michael@0 | 44 | |
michael@0 | 45 | protected: |
michael@0 | 46 | // Although <set> animation might look like to-animation, unlike to-animation, |
michael@0 | 47 | // it never interpolates values. |
michael@0 | 48 | // Returning false here will mean this animation function gets treated as |
michael@0 | 49 | // a single-valued function and no interpolation will be attempted. |
michael@0 | 50 | virtual bool IsToAnimation() const MOZ_OVERRIDE { |
michael@0 | 51 | return false; |
michael@0 | 52 | } |
michael@0 | 53 | |
michael@0 | 54 | // <set> applies the exact same value across the simple duration. |
michael@0 | 55 | virtual bool IsValueFixedForSimpleDuration() const MOZ_OVERRIDE { |
michael@0 | 56 | return true; |
michael@0 | 57 | } |
michael@0 | 58 | virtual bool HasAttr(nsIAtom* aAttName) const MOZ_OVERRIDE; |
michael@0 | 59 | virtual const nsAttrValue* GetAttr(nsIAtom* aAttName) const MOZ_OVERRIDE; |
michael@0 | 60 | virtual bool GetAttr(nsIAtom* aAttName, |
michael@0 | 61 | nsAString& aResult) const MOZ_OVERRIDE; |
michael@0 | 62 | virtual bool WillReplace() const MOZ_OVERRIDE; |
michael@0 | 63 | |
michael@0 | 64 | bool IsDisallowedAttribute(const nsIAtom* aAttribute) const; |
michael@0 | 65 | }; |
michael@0 | 66 | |
michael@0 | 67 | #endif // NS_SMILSETANIMATIONFUNCTION_H_ |