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 #ifndef MOZILLA_SMILENUMTYPE_H_
7 #define MOZILLA_SMILENUMTYPE_H_
9 #include "mozilla/Attributes.h"
10 #include "nsISMILType.h"
12 namespace mozilla {
14 class SMILEnumType : public nsISMILType
15 {
16 public:
17 // Singleton for nsSMILValue objects to hold onto.
18 static SMILEnumType*
19 Singleton()
20 {
21 static SMILEnumType sSingleton;
22 return &sSingleton;
23 }
25 protected:
26 // nsISMILType Methods
27 // -------------------
28 virtual void Init(nsSMILValue& aValue) const MOZ_OVERRIDE;
29 virtual void Destroy(nsSMILValue&) const;
30 virtual nsresult Assign(nsSMILValue& aDest, const nsSMILValue& aSrc) const MOZ_OVERRIDE;
31 virtual bool IsEqual(const nsSMILValue& aLeft,
32 const nsSMILValue& aRight) const MOZ_OVERRIDE;
33 virtual nsresult Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
34 uint32_t aCount) const MOZ_OVERRIDE;
35 virtual nsresult ComputeDistance(const nsSMILValue& aFrom,
36 const nsSMILValue& aTo,
37 double& aDistance) const MOZ_OVERRIDE;
38 virtual nsresult Interpolate(const nsSMILValue& aStartVal,
39 const nsSMILValue& aEndVal,
40 double aUnitDistance,
41 nsSMILValue& aResult) const MOZ_OVERRIDE;
43 private:
44 // Private constructor: prevent instances beyond my singleton.
45 MOZ_CONSTEXPR SMILEnumType() {}
46 };
48 } // namespace mozilla
50 #endif // MOZILLA_SMILENUMTYPE_H_