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 | diff --git a/gfx/cairo/cairo/src/cairo-xlib-display.c b/gfx/cairo/cairo/src/cairo-xlib-display.c |
michael@0 | 2 | --- a/gfx/cairo/cairo/src/cairo-xlib-display.c |
michael@0 | 3 | +++ b/gfx/cairo/cairo/src/cairo-xlib-display.c |
michael@0 | 4 | @@ -216,6 +216,8 @@ _cairo_xlib_display_get (Display *dpy) |
michael@0 | 5 | XExtCodes *codes; |
michael@0 | 6 | int major_unused, minor_unused; |
michael@0 | 7 | |
michael@0 | 8 | + static int buggy_repeat_force = -1; |
michael@0 | 9 | + |
michael@0 | 10 | /* There is an apparent deadlock between this mutex and the |
michael@0 | 11 | * mutex for the display, but it's actually safe. For the |
michael@0 | 12 | * app to call XCloseDisplay() while any other thread is |
michael@0 | 13 | @@ -308,6 +310,26 @@ _cairo_xlib_display_get (Display *dpy) |
michael@0 | 14 | if (VendorRelease (dpy) <= 40500000) |
michael@0 | 15 | display->buggy_repeat = TRUE; |
michael@0 | 16 | } |
michael@0 | 17 | + |
michael@0 | 18 | + /* XXX workaround; see https://bugzilla.mozilla.org/show_bug.cgi?id=413583 */ |
michael@0 | 19 | + /* If buggy_repeat_force == -1, then initialize. |
michael@0 | 20 | + * - set to -2, meaning "nothing was specified", and we trust the above detection. |
michael@0 | 21 | + * - if MOZ_CAIRO_BUGGY_REPEAT is '0' (exactly), then force buggy repeat off |
michael@0 | 22 | + * - if MOZ_CAIRO_BUGGY_REPEAT is '1' (exactly), then force buggy repeat on |
michael@0 | 23 | + */ |
michael@0 | 24 | + if (buggy_repeat_force == -1) { |
michael@0 | 25 | + const char *flag = getenv("MOZ_CAIRO_FORCE_BUGGY_REPEAT"); |
michael@0 | 26 | + |
michael@0 | 27 | + buggy_repeat_force = -2; |
michael@0 | 28 | + |
michael@0 | 29 | + if (flag && flag[0] == '0') |
michael@0 | 30 | + buggy_repeat_force = 0; |
michael@0 | 31 | + else if (flag && flag[0] == '1') |
michael@0 | 32 | + buggy_repeat_force = 1; |
michael@0 | 33 | + } |
michael@0 | 34 | + |
michael@0 | 35 | + if (buggy_repeat_force != -2) |
michael@0 | 36 | + display->buggy_repeat = (buggy_repeat_force == 1); |
michael@0 | 37 | |
michael@0 | 38 | display->next = _cairo_xlib_display_list; |
michael@0 | 39 | _cairo_xlib_display_list = display; |