gfx/skia/trunk/src/animator/SkScriptCallBack.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 SkScriptCallBack_DEFINED
michael@0 9 #define SkScriptCallBack_DEFINED
michael@0 10
michael@0 11 #include "SkOperand2.h"
michael@0 12 #include "SkTDArray_Experimental.h"
michael@0 13
michael@0 14 class SkScriptCallBack {
michael@0 15 public:
michael@0 16 virtual ~SkScriptCallBack() { }
michael@0 17
michael@0 18 enum Type {
michael@0 19 kBox,
michael@0 20 kFunction,
michael@0 21 kMember,
michael@0 22 kMemberFunction,
michael@0 23 kProperty,
michael@0 24 kUnbox
michael@0 25 };
michael@0 26
michael@0 27 virtual bool getReference(const char* , size_t len, SkScriptValue2* result) { return false; }
michael@0 28 virtual SkOperand2::OpType getReturnType(size_t ref, SkOperand2*) {
michael@0 29 return SkOperand2::kS32; }
michael@0 30 virtual Type getType() const = 0;
michael@0 31 };
michael@0 32
michael@0 33 class SkScriptCallBackConvert : public SkScriptCallBack {
michael@0 34 public:
michael@0 35 virtual bool convert(SkOperand2::OpType type, SkOperand2* operand) = 0;
michael@0 36 };
michael@0 37
michael@0 38 class SkScriptCallBackFunction : public SkScriptCallBack {
michael@0 39 public:
michael@0 40 virtual void getParamTypes(SkIntArray(SkOperand2::OpType)* types) = 0;
michael@0 41 virtual Type getType() const { return kFunction; }
michael@0 42 virtual bool invoke(size_t ref, SkOpArray* params, SkOperand2* value) = 0;
michael@0 43 };
michael@0 44
michael@0 45 class SkScriptCallBackMember: public SkScriptCallBack {
michael@0 46 public:
michael@0 47 bool getMemberReference(const char* , size_t len, void* object, SkScriptValue2* ref);
michael@0 48 virtual Type getType() const { return kMember; }
michael@0 49 virtual bool invoke(size_t ref, void* object, SkOperand2* value) = 0;
michael@0 50 };
michael@0 51
michael@0 52 class SkScriptCallBackMemberFunction : public SkScriptCallBack {
michael@0 53 public:
michael@0 54 bool getMemberReference(const char* , size_t len, void* object, SkScriptValue2* ref);
michael@0 55 virtual void getParamTypes(SkIntArray(SkOperand2::OpType)* types) = 0;
michael@0 56 virtual Type getType() const { return kMemberFunction; }
michael@0 57 virtual bool invoke(size_t ref, void* object, SkOpArray* params, SkOperand2* value) = 0;
michael@0 58 };
michael@0 59
michael@0 60 class SkScriptCallBackProperty : public SkScriptCallBack {
michael@0 61 public:
michael@0 62 virtual bool getConstValue(const char* name, size_t len, SkOperand2* value) { return false; }
michael@0 63 virtual bool getResult(size_t ref, SkOperand2* answer) { return false; }
michael@0 64 virtual Type getType() const { return kProperty; }
michael@0 65 };
michael@0 66
michael@0 67 #endif // SkScriptCallBack_DEFINED

mercurial