gfx/skia/trunk/src/svg/SkSVGElements.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 SkSVGElements_DEFINED
    11 #define SkSVGElements_DEFINED
    13 #include "SkSVGPaintState.h"
    14 #include "SkSVGTypes.h"
    15 #include "SkTDArray.h"
    17 class SkSVGParser;
    19 #define DECLARE_SVG_INFO(_type) \
    20 public: \
    21     virtual ~SkSVG##_type(); \
    22     static const SkSVGAttribute gAttributes[]; \
    23     virtual int getAttributes(const SkSVGAttribute** attrPtr); \
    24     virtual SkSVGTypes getType() const; \
    25     virtual void translate(SkSVGParser& parser, bool defState); \
    26     typedef SkSVG##_type BASE_CLASS
    28 #define DEFINE_SVG_INFO(_type) \
    29     SkSVG##_type::~SkSVG##_type() {} \
    30     int SkSVG##_type::getAttributes(const SkSVGAttribute** attrPtr) { \
    31         *attrPtr = gAttributes; \
    32         return SK_ARRAY_COUNT(gAttributes); \
    33     } \
    34     SkSVGTypes SkSVG##_type::getType() const { return SkSVGType_##_type; }
    36 #define DEFINE_SVG_NO_INFO(_type) \
    37     SkSVG##_type::~SkSVG##_type() {} \
    38     int SkSVG##_type::getAttributes(const SkSVGAttribute** ) { return 0; } \
    39     SkSVGTypes SkSVG##_type::getType() const { return SkSVGType_##_type; }
    42 struct SkSVGTypeName {
    43     const char* fName;
    44     SkSVGTypes fType;
    45 };
    47 class SkSVGElement : public SkSVGBase {
    48 public:
    49     SkSVGElement();
    50     virtual ~SkSVGElement();
    51     virtual SkSVGElement* getGradient();
    52     virtual SkSVGTypes getType() const  = 0;
    53     virtual bool isDef();
    54     virtual bool isFlushable();
    55     virtual bool isGroup();
    56     virtual bool isNotDef();
    57     virtual bool onEndElement(SkSVGParser& parser);
    58     virtual bool onStartElement(SkSVGElement* child);
    59     void setIsDef();
    60 //  void setIsNotDef();
    61     virtual void translate(SkSVGParser& parser, bool defState);
    62     virtual void write(SkSVGParser& , SkString& color);
    63     SkString f_id;
    64     SkSVGPaint fPaintState;
    65     SkTDArray<SkSVGElement*> fChildren;
    66     SkSVGElement* fParent;
    67     bool fIsDef;
    68     bool fIsNotDef;
    69 private:
    70     bool isGroupParent();
    71 };
    73 #endif // SkSVGElements_DEFINED

mercurial