gfx/skia/trunk/src/images/SkImageRef_ashmem.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 SkImageRef_ashmem_DEFINED
     9 #define SkImageRef_ashmem_DEFINED
    11 #include "SkImageRef.h"
    13 struct SkAshmemRec {
    14     int     fFD;
    15     void*   fAddr;
    16     size_t  fSize;
    17     bool    fPinned;
    18 };
    20 class SkImageRef_ashmem : public SkImageRef {
    21 public:
    22     SkImageRef_ashmem(const SkImageInfo&, SkStreamRewindable*, int sampleSize = 1);
    23     virtual ~SkImageRef_ashmem();
    25     SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkImageRef_ashmem)
    27 protected:
    28     SkImageRef_ashmem(SkReadBuffer&);
    29     virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
    31     virtual bool onDecode(SkImageDecoder* codec, SkStreamRewindable* stream,
    32                           SkBitmap* bitmap, SkBitmap::Config config,
    33                           SkImageDecoder::Mode mode);
    35     virtual bool onNewLockPixels(LockRec*) SK_OVERRIDE;
    36     virtual void onUnlockPixels() SK_OVERRIDE;
    38 private:
    39     void closeFD();
    41     SkColorTable* fCT;
    42     SkAshmemRec fRec;
    44     typedef SkImageRef INHERITED;
    45 };
    47 #endif

mercurial