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 GFX_LAYERSLOGGING_H |
michael@0 | 7 | #define GFX_LAYERSLOGGING_H |
michael@0 | 8 | |
michael@0 | 9 | #include "FrameMetrics.h" // for FrameMetrics, etc |
michael@0 | 10 | #include "GraphicsFilter.h" // for GraphicsFilter |
michael@0 | 11 | #include "mozilla/gfx/Point.h" // for IntSize, etc |
michael@0 | 12 | #include "mozilla/gfx/Types.h" // for Filter, SurfaceFormat |
michael@0 | 13 | #include "mozilla/layers/CompositorTypes.h" // for TextureFlags |
michael@0 | 14 | #include "nsAString.h" |
michael@0 | 15 | #include "nsPrintfCString.h" // for nsPrintfCString |
michael@0 | 16 | #include "nsRegion.h" // for nsIntRegion |
michael@0 | 17 | #include "nscore.h" // for nsACString, etc |
michael@0 | 18 | |
michael@0 | 19 | class gfx3DMatrix; |
michael@0 | 20 | struct gfxRGBA; |
michael@0 | 21 | struct nsIntPoint; |
michael@0 | 22 | struct nsIntRect; |
michael@0 | 23 | struct nsIntSize; |
michael@0 | 24 | |
michael@0 | 25 | namespace mozilla { |
michael@0 | 26 | namespace gfx { |
michael@0 | 27 | class Matrix4x4; |
michael@0 | 28 | template <class units> struct RectTyped; |
michael@0 | 29 | } |
michael@0 | 30 | |
michael@0 | 31 | namespace layers { |
michael@0 | 32 | |
michael@0 | 33 | nsACString& |
michael@0 | 34 | AppendToString(nsACString& s, const void* p, |
michael@0 | 35 | const char* pfx="", const char* sfx=""); |
michael@0 | 36 | |
michael@0 | 37 | nsACString& |
michael@0 | 38 | AppendToString(nsACString& s, const GraphicsFilter& f, |
michael@0 | 39 | const char* pfx="", const char* sfx=""); |
michael@0 | 40 | |
michael@0 | 41 | nsACString& |
michael@0 | 42 | AppendToString(nsACString& s, FrameMetrics::ViewID n, |
michael@0 | 43 | const char* pfx="", const char* sfx=""); |
michael@0 | 44 | |
michael@0 | 45 | nsACString& |
michael@0 | 46 | AppendToString(nsACString& s, const gfxRGBA& c, |
michael@0 | 47 | const char* pfx="", const char* sfx=""); |
michael@0 | 48 | |
michael@0 | 49 | nsACString& |
michael@0 | 50 | AppendToString(nsACString& s, const gfx3DMatrix& m, |
michael@0 | 51 | const char* pfx="", const char* sfx=""); |
michael@0 | 52 | |
michael@0 | 53 | nsACString& |
michael@0 | 54 | AppendToString(nsACString& s, const nsIntPoint& p, |
michael@0 | 55 | const char* pfx="", const char* sfx=""); |
michael@0 | 56 | |
michael@0 | 57 | template<class T> |
michael@0 | 58 | nsACString& |
michael@0 | 59 | AppendToString(nsACString& s, const mozilla::gfx::PointTyped<T>& p, |
michael@0 | 60 | const char* pfx="", const char* sfx="") |
michael@0 | 61 | { |
michael@0 | 62 | s += pfx; |
michael@0 | 63 | s += nsPrintfCString("(x=%f, y=%f)", p.x, p.y); |
michael@0 | 64 | return s += sfx; |
michael@0 | 65 | } |
michael@0 | 66 | |
michael@0 | 67 | nsACString& |
michael@0 | 68 | AppendToString(nsACString& s, const nsIntRect& r, |
michael@0 | 69 | const char* pfx="", const char* sfx=""); |
michael@0 | 70 | |
michael@0 | 71 | template<class T> |
michael@0 | 72 | nsACString& |
michael@0 | 73 | AppendToString(nsACString& s, const mozilla::gfx::RectTyped<T>& r, |
michael@0 | 74 | const char* pfx="", const char* sfx="") |
michael@0 | 75 | { |
michael@0 | 76 | s += pfx; |
michael@0 | 77 | s.AppendPrintf( |
michael@0 | 78 | "(x=%f, y=%f, w=%f, h=%f)", |
michael@0 | 79 | r.x, r.y, r.width, r.height); |
michael@0 | 80 | return s += sfx; |
michael@0 | 81 | } |
michael@0 | 82 | |
michael@0 | 83 | nsACString& |
michael@0 | 84 | AppendToString(nsACString& s, const nsIntRegion& r, |
michael@0 | 85 | const char* pfx="", const char* sfx=""); |
michael@0 | 86 | |
michael@0 | 87 | nsACString& |
michael@0 | 88 | AppendToString(nsACString& s, const nsIntSize& sz, |
michael@0 | 89 | const char* pfx="", const char* sfx=""); |
michael@0 | 90 | |
michael@0 | 91 | nsACString& |
michael@0 | 92 | AppendToString(nsACString& s, const FrameMetrics& m, |
michael@0 | 93 | const char* pfx="", const char* sfx=""); |
michael@0 | 94 | |
michael@0 | 95 | nsACString& |
michael@0 | 96 | AppendToString(nsACString& s, const mozilla::gfx::IntSize& size, |
michael@0 | 97 | const char* pfx="", const char* sfx=""); |
michael@0 | 98 | |
michael@0 | 99 | nsACString& |
michael@0 | 100 | AppendToString(nsACString& s, const mozilla::gfx::Matrix4x4& m, |
michael@0 | 101 | const char* pfx="", const char* sfx=""); |
michael@0 | 102 | |
michael@0 | 103 | nsACString& |
michael@0 | 104 | AppendToString(nsACString& s, const mozilla::gfx::Filter filter, |
michael@0 | 105 | const char* pfx="", const char* sfx=""); |
michael@0 | 106 | |
michael@0 | 107 | nsACString& |
michael@0 | 108 | AppendToString(nsACString& s, mozilla::layers::TextureFlags flags, |
michael@0 | 109 | const char* pfx="", const char* sfx=""); |
michael@0 | 110 | |
michael@0 | 111 | nsACString& |
michael@0 | 112 | AppendToString(nsACString& s, mozilla::gfx::SurfaceFormat format, |
michael@0 | 113 | const char* pfx="", const char* sfx=""); |
michael@0 | 114 | |
michael@0 | 115 | } // namespace |
michael@0 | 116 | } // namespace |
michael@0 | 117 | |
michael@0 | 118 | #endif /* GFX_LAYERSLOGGING_H */ |