gfx/skia/trunk/include/svg/SkSVGAttribute.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 2006 The Android Open Source Project
     4  *
     5  * Use of this source code is governed by a BSD-style license that can be
     6  * found in the LICENSE file.
     7  */
    10 #ifndef SkSVGAttribute_DEFINED
    11 #define SkSVGAttribute_DEFINED
    13 #include "SkTypes.h"
    15 struct SkSVGAttribute {
    16     const char* fName;
    17 #ifdef SK_DEBUG
    18     size_t fOffset;
    19 #endif
    20 };
    22 #ifndef SK_OFFSETOF
    23 #define SK_OFFSETOF(a, b) (((size_t) (&(((a*) 1)->b)))-1)
    24 #endif
    26 #ifdef SK_DEBUG
    27 #define SVG_ATTRIBUTE(attr) { #attr, SK_OFFSETOF(BASE_CLASS, f_##attr) }
    28 #define SVG_LITERAL_ATTRIBUTE(svgAttr, cAttr) { #svgAttr, SK_OFFSETOF(BASE_CLASS, cAttr) }
    29 #else
    30 #define SVG_ATTRIBUTE(attr) { #attr }
    31 #define SVG_LITERAL_ATTRIBUTE(svgAttr, cAttr) { #svgAttr }
    32 #endif
    34 #define SVG_ADD_ATTRIBUTE(attr) \
    35     if (f_##attr.size() > 0) \
    36         parser._addAttributeLen(#attr, f_##attr.c_str(), f_##attr.size())
    38 #define SVG_ADD_ATTRIBUTE_ALIAS(attr, alias) \
    39     if (f_##alias.size() > 0) \
    40         parser._addAttributeLen(#attr, f_##alias.c_str(), f_##alias.size())
    42 #endif // SkSVGAttribute_DEFINED

mercurial