gfx/skia/trunk/src/images/SkImageRefPool.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     2 /*
     3  * Copyright 2011 Google Inc.
     4  *
     5  * Use of this source code is governed by a BSD-style license that can be
     6  * found in the LICENSE file.
     7  */
     8 #ifndef SkImageRefPool_DEFINED
     9 #define SkImageRefPool_DEFINED
    11 #include "SkTypes.h"
    13 class SkImageRef;
    14 class SkImageRef_GlobalPool;
    16 class SkImageRefPool {
    17 public:
    18     SkImageRefPool();
    19     ~SkImageRefPool();
    21     size_t  getRAMBudget() const { return fRAMBudget; }
    22     void    setRAMBudget(size_t);
    24     size_t  getRAMUsed() const { return fRAMUsed; }
    25     void    setRAMUsed(size_t limit);
    27     void addToHead(SkImageRef*);
    28     void addToTail(SkImageRef*);
    29     void detach(SkImageRef*);
    31     void dump() const;
    33 private:
    34     size_t fRAMBudget;
    35     size_t fRAMUsed;
    37     int         fCount;
    38     SkImageRef* fHead, *fTail;
    40     int computeCount() const;
    42     friend class SkImageRef_GlobalPool;
    44     void justAddedPixels(SkImageRef*);
    45     void canLosePixels(SkImageRef*);
    46     void purgeIfNeeded();
    47 };
    49 #endif

mercurial