gfx/layers/LayersLogging.h

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

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

mercurial