gfx/skia/trunk/src/animator/SkOperand.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 SkOperand_DEFINED
    11 #define SkOperand_DEFINED
    13 #include "SkDisplayType.h"
    15 class SkTypedArray;
    16 class SkDisplayable;
    17 class SkDrawable;
    18 class SkString;
    20 union SkOperand {
    21 //  SkOperand() {}
    22 //  SkOperand(SkScalar scalar) : fScalar(scalar) {}
    23     SkTypedArray* fArray;
    24     SkDisplayable* fDisplayable;
    25     SkDrawable* fDrawable;
    26     void* fObject;
    27     int32_t fS32;
    28     SkMSec fMSec;
    29     SkScalar fScalar;
    30     SkString* fString;
    31 };
    33 struct SkScriptValue {
    34     SkOperand fOperand;
    35     SkDisplayTypes fType;
    36     SkTypedArray* getArray() { SkASSERT(fType == SkType_Array); return fOperand.fArray; }
    37     SkDisplayable* getDisplayable() { SkASSERT(fType == SkType_Displayable); return fOperand.fDisplayable; }
    38     SkDrawable* getDrawable() { SkASSERT(fType == SkType_Drawable); return fOperand.fDrawable; }
    39     int32_t getS32(SkAnimateMaker* maker) { SkASSERT(fType == SkType_Int || fType == SkType_Boolean ||
    40         SkDisplayType::IsEnum(maker, fType)); return fOperand.fS32; }
    41     SkMSec getMSec() { SkASSERT(fType == SkType_MSec); return fOperand.fMSec; }
    42     SkScalar getScalar() { SkASSERT(fType == SkType_Float); return fOperand.fScalar; }
    43     SkString* getString() { SkASSERT(fType == SkType_String); return fOperand.fString; }
    44 };
    46 #endif // SkOperand_DEFINED

mercurial