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) 2010 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 | #include "GLSLANG/ShaderLang.h" |
michael@0 | 8 | #include "compiler/intermediate.h" |
michael@0 | 9 | |
michael@0 | 10 | class TInfoSinkBase; |
michael@0 | 11 | |
michael@0 | 12 | struct TLoopInfo { |
michael@0 | 13 | struct TIndex { |
michael@0 | 14 | int id; // symbol id. |
michael@0 | 15 | } index; |
michael@0 | 16 | TIntermLoop* loop; |
michael@0 | 17 | }; |
michael@0 | 18 | typedef TVector<TLoopInfo> TLoopStack; |
michael@0 | 19 | |
michael@0 | 20 | // Traverses intermediate tree to ensure that the shader does not exceed the |
michael@0 | 21 | // minimum functionality mandated in GLSL 1.0 spec, Appendix A. |
michael@0 | 22 | class ValidateLimitations : public TIntermTraverser { |
michael@0 | 23 | public: |
michael@0 | 24 | ValidateLimitations(ShShaderType shaderType, TInfoSinkBase& sink); |
michael@0 | 25 | |
michael@0 | 26 | int numErrors() const { return mNumErrors; } |
michael@0 | 27 | |
michael@0 | 28 | virtual bool visitBinary(Visit, TIntermBinary*); |
michael@0 | 29 | virtual bool visitUnary(Visit, TIntermUnary*); |
michael@0 | 30 | virtual bool visitAggregate(Visit, TIntermAggregate*); |
michael@0 | 31 | virtual bool visitLoop(Visit, TIntermLoop*); |
michael@0 | 32 | |
michael@0 | 33 | private: |
michael@0 | 34 | void error(TSourceLoc loc, const char *reason, const char* token); |
michael@0 | 35 | |
michael@0 | 36 | bool withinLoopBody() const; |
michael@0 | 37 | bool isLoopIndex(const TIntermSymbol* symbol) const; |
michael@0 | 38 | bool validateLoopType(TIntermLoop* node); |
michael@0 | 39 | bool validateForLoopHeader(TIntermLoop* node, TLoopInfo* info); |
michael@0 | 40 | bool validateForLoopInit(TIntermLoop* node, TLoopInfo* info); |
michael@0 | 41 | bool validateForLoopCond(TIntermLoop* node, TLoopInfo* info); |
michael@0 | 42 | bool validateForLoopExpr(TIntermLoop* node, TLoopInfo* info); |
michael@0 | 43 | // Returns true if none of the loop indices is used as the argument to |
michael@0 | 44 | // the given function out or inout parameter. |
michael@0 | 45 | bool validateFunctionCall(TIntermAggregate* node); |
michael@0 | 46 | bool validateOperation(TIntermOperator* node, TIntermNode* operand); |
michael@0 | 47 | |
michael@0 | 48 | // Returns true if indexing does not exceed the minimum functionality |
michael@0 | 49 | // mandated in GLSL 1.0 spec, Appendix A, Section 5. |
michael@0 | 50 | bool isConstExpr(TIntermNode* node); |
michael@0 | 51 | bool isConstIndexExpr(TIntermNode* node); |
michael@0 | 52 | bool validateIndexing(TIntermBinary* node); |
michael@0 | 53 | |
michael@0 | 54 | ShShaderType mShaderType; |
michael@0 | 55 | TInfoSinkBase& mSink; |
michael@0 | 56 | int mNumErrors; |
michael@0 | 57 | TLoopStack mLoopStack; |
michael@0 | 58 | }; |
michael@0 | 59 |