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 | // Copyright (c) 2011 The ANGLE Project Authors. All rights reserved. |
michael@0 | 3 | // Use of this source code is governed by a BSD-style license that can be |
michael@0 | 4 | // found in the LICENSE file. |
michael@0 | 5 | // |
michael@0 | 6 | |
michael@0 | 7 | #ifndef ForLoopUnroll_h |
michael@0 | 8 | #define ForLoopUnroll_h |
michael@0 | 9 | |
michael@0 | 10 | #include "compiler/intermediate.h" |
michael@0 | 11 | |
michael@0 | 12 | struct TLoopIndexInfo { |
michael@0 | 13 | int id; |
michael@0 | 14 | int initValue; |
michael@0 | 15 | int stopValue; |
michael@0 | 16 | int incrementValue; |
michael@0 | 17 | TOperator op; |
michael@0 | 18 | int currentValue; |
michael@0 | 19 | }; |
michael@0 | 20 | |
michael@0 | 21 | class ForLoopUnroll { |
michael@0 | 22 | public: |
michael@0 | 23 | ForLoopUnroll() { } |
michael@0 | 24 | |
michael@0 | 25 | void FillLoopIndexInfo(TIntermLoop* node, TLoopIndexInfo& info); |
michael@0 | 26 | |
michael@0 | 27 | // Update the info.currentValue for the next loop iteration. |
michael@0 | 28 | void Step(); |
michael@0 | 29 | |
michael@0 | 30 | // Return false if loop condition is no longer satisfied. |
michael@0 | 31 | bool SatisfiesLoopCondition(); |
michael@0 | 32 | |
michael@0 | 33 | // Check if the symbol is the index of a loop that's unrolled. |
michael@0 | 34 | bool NeedsToReplaceSymbolWithValue(TIntermSymbol* symbol); |
michael@0 | 35 | |
michael@0 | 36 | // Return the current value of a given loop index symbol. |
michael@0 | 37 | int GetLoopIndexValue(TIntermSymbol* symbol); |
michael@0 | 38 | |
michael@0 | 39 | void Push(TLoopIndexInfo& info); |
michael@0 | 40 | void Pop(); |
michael@0 | 41 | |
michael@0 | 42 | static void MarkForLoopsWithIntegerIndicesForUnrolling(TIntermNode* root); |
michael@0 | 43 | |
michael@0 | 44 | private: |
michael@0 | 45 | int getLoopIncrement(TIntermLoop* node); |
michael@0 | 46 | |
michael@0 | 47 | int evaluateIntConstant(TIntermConstantUnion* node); |
michael@0 | 48 | |
michael@0 | 49 | TVector<TLoopIndexInfo> mLoopIndexStack; |
michael@0 | 50 | }; |
michael@0 | 51 | |
michael@0 | 52 | #endif |