gfx/skia/trunk/src/core/SkFontStream.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.

     1 /*
     2  * Copyright 2013 Google Inc.
     3  *
     4  * Use of this source code is governed by a BSD-style license that can be
     5  * found in the LICENSE file.
     6  */
     8 #ifndef SkFontStream_DEFINED
     9 #define SkFontStream_DEFINED
    11 class SkStream;
    13 #include "SkTypeface.h"
    15 class SkFontStream {
    16 public:
    17     /**
    18      *  Return the number of shared directories inside a TTC sfnt, or return 1
    19      *  if the stream is a normal sfnt (ttf). If there is an error or
    20      *  no directory is found, return 0.
    21      *
    22      *  Note: the stream is rewound initially, but is returned at an arbitrary
    23      *  read offset.
    24      */
    25     static int CountTTCEntries(SkStream*);
    27     /**
    28      *  @param ttcIndex 0 for normal sfnts, or the index within a TTC sfnt.
    29      *
    30      *  Note: the stream is rewound initially, but is returned at an arbitrary
    31      *  read offset.
    32      */
    33     static int GetTableTags(SkStream*, int ttcIndex, SkFontTableTag tags[]);
    35     /**
    36      *  @param ttcIndex 0 for normal sfnts, or the index within a TTC sfnt.
    37      *
    38      *  Note: the stream is rewound initially, but is returned at an arbitrary
    39      *  read offset.
    40      */
    41     static size_t GetTableData(SkStream*, int ttcIndex, SkFontTableTag tag,
    42                                size_t offset, size_t length, void* data);
    44     static size_t GetTableSize(SkStream* stream, int ttcIndex, SkFontTableTag tag) {
    45         return GetTableData(stream, ttcIndex, tag, 0, ~0U, NULL);
    46     }
    47 };
    49 #endif

mercurial