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 SkAnimatorScript_DEFINED |
michael@0 | 11 | #define SkAnimatorScript_DEFINED |
michael@0 | 12 | |
michael@0 | 13 | #include "SkDisplayable.h" |
michael@0 | 14 | #include "SkScript.h" |
michael@0 | 15 | #include "SkTypedArray.h" |
michael@0 | 16 | |
michael@0 | 17 | class SkAnimateMaker; |
michael@0 | 18 | struct SkMemberInfo; |
michael@0 | 19 | |
michael@0 | 20 | struct SkDisplayEnumMap { |
michael@0 | 21 | SkDisplayTypes fType; |
michael@0 | 22 | const char* fValues; |
michael@0 | 23 | }; |
michael@0 | 24 | |
michael@0 | 25 | class SkAnimatorScript : public SkScriptEngine { |
michael@0 | 26 | public: |
michael@0 | 27 | SkAnimatorScript(SkAnimateMaker& , SkDisplayable* , SkDisplayTypes type); |
michael@0 | 28 | ~SkAnimatorScript(); |
michael@0 | 29 | bool evaluate(const char* script, SkScriptValue* , SkDisplayTypes type); |
michael@0 | 30 | void track(SkDisplayable* displayable) { |
michael@0 | 31 | SkASSERT(fTrackDisplayable.find(displayable) < 0); |
michael@0 | 32 | *fTrackDisplayable.append() = displayable; } |
michael@0 | 33 | static bool EvaluateDisplayable(SkAnimateMaker& , SkDisplayable* , const char* script, SkDisplayable** ); |
michael@0 | 34 | static bool EvaluateFloat(SkAnimateMaker& , SkDisplayable* , const char* script, SkScalar* ); |
michael@0 | 35 | static bool EvaluateInt(SkAnimateMaker& , SkDisplayable* , const char* script, int32_t* ); |
michael@0 | 36 | static bool EvaluateString(SkAnimateMaker& , SkDisplayable* , const char* script, SkString* ); |
michael@0 | 37 | static bool EvaluateString(SkAnimateMaker& , SkDisplayable* , SkDisplayable* parent, const char* script, SkString* ); |
michael@0 | 38 | static bool MapEnums(const char* ptr, const char* match, size_t len, int* value); |
michael@0 | 39 | protected: |
michael@0 | 40 | static bool Box(void* user, SkScriptValue* ); |
michael@0 | 41 | static bool Eval(const char* function, size_t len, SkTDArray<SkScriptValue>& params, |
michael@0 | 42 | void* callBack, SkScriptValue* ); |
michael@0 | 43 | static bool EvalEnum(const char* token, size_t len, void* callBack, SkScriptValue* ); |
michael@0 | 44 | static bool EvalID(const char* token, size_t len, void* callBack, SkScriptValue* ); |
michael@0 | 45 | static bool EvalMember(const char* member, size_t len, void* object, void* eng, |
michael@0 | 46 | SkScriptValue* value); |
michael@0 | 47 | static bool EvalMemberCommon(SkScriptEngine* , const SkMemberInfo* info, |
michael@0 | 48 | SkDisplayable* displayable, SkScriptValue* value); |
michael@0 | 49 | static bool EvalMemberFunction(const char* member, size_t len, void* object, |
michael@0 | 50 | SkTDArray<SkScriptValue>& params, void* user, SkScriptValue* value); |
michael@0 | 51 | static bool EvalNamedColor(const char* token, size_t len, void* callBack, SkScriptValue* ); |
michael@0 | 52 | static bool EvalRGB(const char* function, size_t len, SkTDArray<SkScriptValue>& params, |
michael@0 | 53 | void* callBack, SkScriptValue* ); |
michael@0 | 54 | static const SkDisplayEnumMap& GetEnumValues(SkDisplayTypes type); |
michael@0 | 55 | static bool Infinity(const char* token, size_t len, void* callBack, SkScriptValue* ); |
michael@0 | 56 | static bool IsFinite(const char* function, size_t len, SkTDArray<SkScriptValue>& params, |
michael@0 | 57 | void* callBack, SkScriptValue* ); |
michael@0 | 58 | static bool IsNaN(const char* function, size_t len, SkTDArray<SkScriptValue>& params, |
michael@0 | 59 | void* callBack, SkScriptValue* ); |
michael@0 | 60 | static bool NaN(const char* token, size_t len, void* callBack, SkScriptValue* ); |
michael@0 | 61 | static bool Unbox(void* , SkScriptValue* scriptValue); |
michael@0 | 62 | SkTDDisplayableArray fTrackDisplayable; |
michael@0 | 63 | SkAnimateMaker& fMaker; |
michael@0 | 64 | SkDisplayable* fParent; |
michael@0 | 65 | SkDisplayable* fWorking; |
michael@0 | 66 | private: |
michael@0 | 67 | friend class SkDump; |
michael@0 | 68 | friend struct SkScriptNAnswer; |
michael@0 | 69 | #ifdef SK_SUPPORT_UNITTEST |
michael@0 | 70 | public: |
michael@0 | 71 | static void UnitTest(); |
michael@0 | 72 | #endif |
michael@0 | 73 | }; |
michael@0 | 74 | |
michael@0 | 75 | #endif // SkAnimatorScript_DEFINED |