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 /* vim:set ts=2 sw=2 sts=2 et cindent: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 /**
8 * Other similar methods can be added if needed.
9 */
11 #include "ThreeDPoint.h"
12 #include "WebAudioUtils.h"
14 namespace mozilla {
16 namespace dom {
18 bool
19 ThreeDPoint::FuzzyEqual(const ThreeDPoint& other)
20 {
21 return WebAudioUtils::FuzzyEqual(x, other.x) &&
22 WebAudioUtils::FuzzyEqual(y, other.y) &&
23 WebAudioUtils::FuzzyEqual(z, other.z);
24 }
26 ThreeDPoint operator-(const ThreeDPoint& lhs, const ThreeDPoint& rhs)
27 {
28 return ThreeDPoint(lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z);
29 }
31 ThreeDPoint operator*(const ThreeDPoint& lhs, const ThreeDPoint& rhs)
32 {
33 return ThreeDPoint(lhs.x * rhs.x, lhs.y * rhs.y, lhs.z * rhs.z);
34 }
36 ThreeDPoint operator*(const ThreeDPoint& lhs, const double rhs)
37 {
38 return ThreeDPoint(lhs.x * rhs, lhs.y * rhs, lhs.z * rhs);
39 }
41 bool operator==(const ThreeDPoint& lhs, const ThreeDPoint& rhs)
42 {
43 return lhs.x == rhs.x &&
44 lhs.y == rhs.y &&
45 lhs.z == rhs.z;
46 }
48 }
49 }