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 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 include protocol PGrallocBuffer;
8 using struct gfxPoint from "gfxPoint.h";
9 using struct nsIntRect from "nsRect.h";
10 using nsIntRegion from "nsRegion.h";
11 using struct nsIntSize from "nsSize.h";
12 using struct mozilla::layers::MagicGrallocBufferHandle from "gfxipc/ShadowLayerUtils.h";
13 using struct mozilla::layers::SurfaceDescriptorX11 from "gfxipc/ShadowLayerUtils.h";
14 using struct mozilla::null_t from "ipc/IPCMessageUtils.h";
15 using mozilla::WindowsHandle from "ipc/IPCMessageUtils.h";
16 using mozilla::gl::SharedTextureHandle from "GLContextTypes.h";
17 using mozilla::gl::SharedTextureShareType from "GLContextTypes.h";
18 using mozilla::gfx::SurfaceStreamHandle from "SurfaceTypes.h";
19 using mozilla::gfx::SurfaceFormat from "mozilla/gfx/Types.h";
20 using mozilla::gfx::IntSize from "mozilla/gfx/Point.h";
21 using gfxImageFormat from "gfxTypes.h";
23 namespace mozilla {
24 namespace layers {
26 union MaybeMagicGrallocBufferHandle {
27 MagicGrallocBufferHandle;
28 null_t;
29 };
31 struct SurfaceDescriptorD3D9 {
32 // IDirect3DTexture9*
33 uintptr_t texture;
34 };
36 struct SurfaceDescriptorDIB {
37 // gfxWindowsSurface*
38 uintptr_t surface;
39 };
41 struct SurfaceDescriptorD3D10 {
42 WindowsHandle handle;
43 SurfaceFormat format;
44 IntSize size;
45 };
47 struct SurfaceDescriptorMacIOSurface {
48 uint32_t surface;
49 double scaleFactor;
50 bool hasAlpha;
51 };
53 struct SharedTextureDescriptor {
54 SharedTextureShareType shareType;
55 SharedTextureHandle handle;
56 IntSize size;
57 bool inverted;
58 };
60 struct NewSurfaceDescriptorGralloc {
61 PGrallocBuffer buffer;
62 /**
63 * android::GraphicBuffer has a size information. But there are cases
64 * that GraphicBuffer's size and actual video's size are different.
65 * Extra size member is necessary. See Bug 850566.
66 */
67 IntSize size;
68 };
70 struct SurfaceStreamDescriptor {
71 SurfaceStreamHandle handle;
72 bool yflip;
73 };
75 /**
76 * Used for shmem-backed YCbCr and (flavors of) RGBA textures
77 */
78 struct SurfaceDescriptorShmem {
79 Shmem data;
80 SurfaceFormat format;
81 };
83 /**
84 * Used for "raw memory"-backed YCbCr and (flavors of) RGBA textures
85 */
86 struct SurfaceDescriptorMemory {
87 uintptr_t data;
88 SurfaceFormat format;
89 };
91 union SurfaceDescriptor {
92 SurfaceDescriptorShmem;
93 SurfaceDescriptorMemory;
94 SurfaceDescriptorD3D9;
95 SurfaceDescriptorDIB;
96 SurfaceDescriptorD3D10;
97 SurfaceDescriptorX11;
98 SharedTextureDescriptor;
99 SurfaceStreamDescriptor;
100 SurfaceDescriptorMacIOSurface;
101 NewSurfaceDescriptorGralloc;
102 null_t;
103 };
105 } // namespace
106 } // namespace