gfx/skia/trunk/src/animator/SkOperand2.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 SkOperand2_DEFINED
     9 #define SkOperand2_DEFINED
    11 #include "SkScalar.h"
    13 class SkOpArray;
    14 class SkString;
    16 union SkOperand2 {
    17     enum OpType {
    18         kNoType,
    19         kS32 = 1,
    20         kScalar = 2,
    21         kString = 4,
    22         kArray = 8,
    23         kObject = 16
    24     };
    25     SkOpArray* fArray;
    26     void* fObject;
    27     size_t fReference;
    28     int32_t fS32;
    29     SkScalar fScalar;
    30     SkString* fString;
    31 };
    33 struct SkScriptValue2 {
    34     enum IsConstant {
    35         kConstant,
    36         kVariable
    37     };
    38     enum IsWritten {
    39         kUnwritten,
    40         kWritten
    41     };
    42     SkOperand2 fOperand;
    43     SkOperand2::OpType fType : 8;
    44     IsConstant fIsConstant : 8;
    45     IsWritten fIsWritten : 8;
    46     SkOpArray* getArray() { SkASSERT(fType == SkOperand2::kArray); return fOperand.fArray; }
    47     void* getObject() { SkASSERT(fType == SkOperand2::kObject); return fOperand.fObject; }
    48     int32_t getS32() { SkASSERT(fType == SkOperand2::kS32); return fOperand.fS32; }
    49     SkScalar getScalar() { SkASSERT(fType == SkOperand2::kScalar); return fOperand.fScalar; }
    50     SkString* getString() { SkASSERT(fType == SkOperand2::kString); return fOperand.fString; }
    51         bool isConstant() const { return fIsConstant == kConstant; }
    52 };
    54 #endif // SkOperand2_DEFINED

mercurial