image/src/DecodeStrategy.h

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
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  *
     3  * This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 /** @file
     8  * An enumeration used by RasterImage and Decoder to specify which 'strategy' to
     9  * use for image decoding - synchronous or asynchronous.
    10  */
    12 #ifndef mozilla_imagelib_DecodeStrategy_h_
    13 #define mozilla_imagelib_DecodeStrategy_h_
    15 namespace mozilla {
    16 namespace image {
    18 enum DecodeStrategy {
    19   // DECODE_SYNC requests a synchronous decode, which will continue decoding
    20   // frames as long as it has more source data. It returns to the caller only
    21   // once decoding is complete (or until it needs more source data before
    22   // continuing). Because DECODE_SYNC can involve allocating new imgFrames, it
    23   // can only be run on the main thread.
    24   DECODE_SYNC,
    26   // DECODE_ASYNC requests an asynchronous decode, which will continue decoding
    27   // until it either finishes a frame or runs out of source data. Because
    28   // DECODE_ASYNC does not allocate new imgFrames, it can be safely run off the
    29   // main thread. (And hence workers in the decode pool always use it.)
    30   DECODE_ASYNC
    31 };
    33 } // namespace image
    34 } // namespace mozilla
    36 #endif

mercurial