gfx/skia/trunk/src/animator/SkScriptRuntime.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 2011 Google Inc.
     4  *
     5  * Use of this source code is governed by a BSD-style license that can be
     6  * found in the LICENSE file.
     7  */
     8 #ifndef SkScriptRuntime_DEFINED
     9 #define SkScriptRuntime_DEFINED
    11 #include "SkOperand2.h"
    12 #include "SkTDArray_Experimental.h"
    13 #include "SkTDStack.h"
    15 class SkScriptCallBack;
    17 typedef SkLongArray(SkString*) SkTDStringArray;
    18 typedef SkLongArray(SkScriptCallBack*) SkTDScriptCallBackArray;
    20 class SkScriptRuntime {
    21 public:
    22     enum SkError {
    23         kNoError,
    24         kArrayIndexOutOfBounds,
    25         kCouldNotFindReferencedID,
    26         kFunctionCallFailed,
    27         kMemberOpFailed,
    28         kPropertyOpFailed
    29     };
    31     SkScriptRuntime(SkTDScriptCallBackArray& callBackArray) : fCallBackArray(callBackArray)
    32         {  }
    33     ~SkScriptRuntime();
    34     bool executeTokens(unsigned char* opCode);
    35     bool getResult(SkOperand2* result);
    36     void untrack(SkOpArray* array);
    37     void untrack(SkString* string);
    38 private:
    39     void track(SkOpArray* array);
    40     void track(SkString* string);
    41     SkTDScriptCallBackArray& fCallBackArray;
    42     SkError fError;
    43     SkTDStack<SkOperand2> fRunStack;
    44     SkLongArray(SkOpArray*) fTrackArray;
    45     SkTDStringArray fTrackString;
    46     // illegal
    47     SkScriptRuntime& operator=(const SkScriptRuntime&);
    48 };
    50 #endif // SkScriptRuntime_DEFINED

mercurial