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.

michael@0 1
michael@0 2 /*
michael@0 3 * Copyright 2011 Google Inc.
michael@0 4 *
michael@0 5 * Use of this source code is governed by a BSD-style license that can be
michael@0 6 * found in the LICENSE file.
michael@0 7 */
michael@0 8 #ifndef SkOperand2_DEFINED
michael@0 9 #define SkOperand2_DEFINED
michael@0 10
michael@0 11 #include "SkScalar.h"
michael@0 12
michael@0 13 class SkOpArray;
michael@0 14 class SkString;
michael@0 15
michael@0 16 union SkOperand2 {
michael@0 17 enum OpType {
michael@0 18 kNoType,
michael@0 19 kS32 = 1,
michael@0 20 kScalar = 2,
michael@0 21 kString = 4,
michael@0 22 kArray = 8,
michael@0 23 kObject = 16
michael@0 24 };
michael@0 25 SkOpArray* fArray;
michael@0 26 void* fObject;
michael@0 27 size_t fReference;
michael@0 28 int32_t fS32;
michael@0 29 SkScalar fScalar;
michael@0 30 SkString* fString;
michael@0 31 };
michael@0 32
michael@0 33 struct SkScriptValue2 {
michael@0 34 enum IsConstant {
michael@0 35 kConstant,
michael@0 36 kVariable
michael@0 37 };
michael@0 38 enum IsWritten {
michael@0 39 kUnwritten,
michael@0 40 kWritten
michael@0 41 };
michael@0 42 SkOperand2 fOperand;
michael@0 43 SkOperand2::OpType fType : 8;
michael@0 44 IsConstant fIsConstant : 8;
michael@0 45 IsWritten fIsWritten : 8;
michael@0 46 SkOpArray* getArray() { SkASSERT(fType == SkOperand2::kArray); return fOperand.fArray; }
michael@0 47 void* getObject() { SkASSERT(fType == SkOperand2::kObject); return fOperand.fObject; }
michael@0 48 int32_t getS32() { SkASSERT(fType == SkOperand2::kS32); return fOperand.fS32; }
michael@0 49 SkScalar getScalar() { SkASSERT(fType == SkOperand2::kScalar); return fOperand.fScalar; }
michael@0 50 SkString* getString() { SkASSERT(fType == SkOperand2::kString); return fOperand.fString; }
michael@0 51 bool isConstant() const { return fIsConstant == kConstant; }
michael@0 52 };
michael@0 53
michael@0 54 #endif // SkOperand2_DEFINED

mercurial