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 | # HG changeset patch |
michael@0 | 2 | # User Matt Woodrow <mwoodrow@mozilla.com> |
michael@0 | 3 | # Date 1314162877 -43200 |
michael@0 | 4 | # Node ID 87458c4670dcd16be5a5715d741ee2ca4cf18d0f |
michael@0 | 5 | # Parent 95eb700a64591cda694c284a9f8ad08c11e3dd97 |
michael@0 | 6 | Bug 675837 - Only flush Quartz surfaces on the success paths during cairo_quartz_get_image. r=roc |
michael@0 | 7 | |
michael@0 | 8 | diff --git a/gfx/cairo/cairo/src/cairo-quartz-surface.c b/gfx/cairo/cairo/src/cairo-quartz-surface.c |
michael@0 | 9 | --- a/gfx/cairo/cairo/src/cairo-quartz-surface.c |
michael@0 | 10 | +++ b/gfx/cairo/cairo/src/cairo-quartz-surface.c |
michael@0 | 11 | @@ -1909,30 +1909,30 @@ _cairo_quartz_get_image (cairo_quartz_su |
michael@0 | 12 | unsigned char *imageData; |
michael@0 | 13 | cairo_image_surface_t *isurf; |
michael@0 | 14 | |
michael@0 | 15 | if (IS_EMPTY(surface)) { |
michael@0 | 16 | *image_out = (cairo_image_surface_t*) cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 0, 0); |
michael@0 | 17 | return CAIRO_STATUS_SUCCESS; |
michael@0 | 18 | } |
michael@0 | 19 | |
michael@0 | 20 | - CGContextFlush(surface->cgContext); |
michael@0 | 21 | - |
michael@0 | 22 | if (surface->imageSurfaceEquiv) { |
michael@0 | 23 | + CGContextFlush(surface->cgContext); |
michael@0 | 24 | *image_out = (cairo_image_surface_t*) cairo_surface_reference(surface->imageSurfaceEquiv); |
michael@0 | 25 | return CAIRO_STATUS_SUCCESS; |
michael@0 | 26 | } |
michael@0 | 27 | |
michael@0 | 28 | if (_cairo_quartz_is_cgcontext_bitmap_context(surface->cgContext)) { |
michael@0 | 29 | unsigned int stride; |
michael@0 | 30 | unsigned int bitinfo; |
michael@0 | 31 | unsigned int bpc, bpp; |
michael@0 | 32 | CGColorSpaceRef colorspace; |
michael@0 | 33 | unsigned int color_comps; |
michael@0 | 34 | |
michael@0 | 35 | + CGContextFlush(surface->cgContext); |
michael@0 | 36 | imageData = (unsigned char *) CGBitmapContextGetData(surface->cgContext); |
michael@0 | 37 | |
michael@0 | 38 | #ifdef USE_10_3_WORKAROUNDS |
michael@0 | 39 | bitinfo = CGBitmapContextGetAlphaInfo (surface->cgContext); |
michael@0 | 40 | #else |
michael@0 | 41 | bitinfo = CGBitmapContextGetBitmapInfo (surface->cgContext); |
michael@0 | 42 | #endif |
michael@0 | 43 | stride = CGBitmapContextGetBytesPerRow (surface->cgContext); |