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: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 __txCore_h__
7 #define __txCore_h__
9 #include "nscore.h"
10 #include "nsDebug.h"
11 #include "nsISupportsImpl.h"
13 class nsAString;
15 class txObject
16 {
17 public:
18 txObject()
19 {
20 MOZ_COUNT_CTOR(txObject);
21 }
23 /**
24 * Deletes this txObject
25 */
26 virtual ~txObject()
27 {
28 MOZ_COUNT_DTOR(txObject);
29 }
30 };
32 /**
33 * Utility class for doubles
34 */
35 class txDouble
36 {
37 public:
38 /**
39 * Converts the value of the given double to a string, and appends
40 * the result to the destination string.
41 */
42 static void toString(double aValue, nsAString& aDest);
44 /**
45 * Converts the given String to a double, if the string value does not
46 * represent a double, NaN will be returned.
47 */
48 static double toDouble(const nsAString& aStr);
49 };
51 #endif