Sat, 03 Jan 2015 20:18:00 +0100
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 2006 The Android Open Source Project |
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 | |
michael@0 | 9 | |
michael@0 | 10 | #ifndef SkAnimateActive_DEFINED |
michael@0 | 11 | #define SkAnimateActive_DEFINED |
michael@0 | 12 | |
michael@0 | 13 | #include "SkDisplayApply.h" |
michael@0 | 14 | #include "SkOperandInterpolator.h" |
michael@0 | 15 | #include "SkIntArray.h" |
michael@0 | 16 | |
michael@0 | 17 | class SkAnimateMaker; |
michael@0 | 18 | |
michael@0 | 19 | class SkActive { |
michael@0 | 20 | public: |
michael@0 | 21 | SkActive(SkApply& , SkAnimateMaker& ); |
michael@0 | 22 | ~SkActive(); |
michael@0 | 23 | void advance(); |
michael@0 | 24 | void append(SkApply* ); |
michael@0 | 25 | void calcDurations(int index); |
michael@0 | 26 | void create(SkDrawable* scope, SkMSec time); |
michael@0 | 27 | bool draw() { return immediate(false); } |
michael@0 | 28 | bool enable() { return immediate(true); } |
michael@0 | 29 | void init( ); |
michael@0 | 30 | SkMSec getTime(SkMSec inTime, int animatorIndex); |
michael@0 | 31 | void pickUp(SkActive* existing); |
michael@0 | 32 | void reset() { fDrawIndex = 0; } |
michael@0 | 33 | void setInterpolator(int index, SkOperand* from); |
michael@0 | 34 | void start(); |
michael@0 | 35 | #ifdef SK_DEBUG |
michael@0 | 36 | void validate(); |
michael@0 | 37 | #endif |
michael@0 | 38 | private: |
michael@0 | 39 | void appendSave(int oldCount); |
michael@0 | 40 | void fixInterpolator(SkBool save); |
michael@0 | 41 | bool immediate(bool enable); |
michael@0 | 42 | bool initializeSave(); |
michael@0 | 43 | void initState(SkApply* , int offset); |
michael@0 | 44 | void resetInterpolators(); |
michael@0 | 45 | void resetState(); |
michael@0 | 46 | void restoreInterpolatorValues(int index); |
michael@0 | 47 | void saveInterpolatorValues(int index); |
michael@0 | 48 | void setSteps(int steps); |
michael@0 | 49 | struct SkState { |
michael@0 | 50 | // void bumpSave(); |
michael@0 | 51 | SkMSec getRelativeTime(SkMSec time); |
michael@0 | 52 | SkApply::Mode fMode; |
michael@0 | 53 | SkApply::Transition fTransition; |
michael@0 | 54 | SkBool8 fPickup; |
michael@0 | 55 | SkBool8 fRestore; |
michael@0 | 56 | SkBool8 fStarted; |
michael@0 | 57 | SkBool8 fUnpostedEndEvent; |
michael@0 | 58 | int32_t fSteps; |
michael@0 | 59 | SkMSec fBegin; |
michael@0 | 60 | SkMSec fStartTime; |
michael@0 | 61 | SkMSec fDuration; |
michael@0 | 62 | SkMSec fSave; |
michael@0 | 63 | SkMSec fTicks; |
michael@0 | 64 | }; |
michael@0 | 65 | SkActive& operator= (const SkActive& ); |
michael@0 | 66 | SkTDArray<SkOperandInterpolator*> fInterpolators; |
michael@0 | 67 | SkApply& fApply; |
michael@0 | 68 | SkTDArray<SkState> fState; // one per animator |
michael@0 | 69 | SkTDOperandPtrArray fSaveRestore; // if apply has restore="true" |
michael@0 | 70 | SkTDOperandPtrArray fSaveInterpolators; |
michael@0 | 71 | SkTDAnimateArray fAnimators; |
michael@0 | 72 | SkMSec fMaxTime; // greatest of all animation durations; only used by immediate mode |
michael@0 | 73 | SkAnimateMaker& fMaker; |
michael@0 | 74 | int fDrawIndex; |
michael@0 | 75 | int fDrawMax; |
michael@0 | 76 | friend class SkApply; |
michael@0 | 77 | }; |
michael@0 | 78 | |
michael@0 | 79 | #endif // SkAnimateActive_DEFINED |