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.
1 //
2 // Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
7 #include "compiler/TranslatorESSL.h"
9 #include "compiler/OutputESSL.h"
11 TranslatorESSL::TranslatorESSL(ShShaderType type, ShShaderSpec spec)
12 : TCompiler(type, spec) {
13 }
15 void TranslatorESSL::translate(TIntermNode* root) {
16 TInfoSinkBase& sink = getInfoSink().obj;
18 // Write built-in extension behaviors.
19 writeExtensionBehavior();
21 // Write emulated built-in functions if needed.
22 getBuiltInFunctionEmulator().OutputEmulatedFunctionDefinition(
23 sink, getShaderType() == SH_FRAGMENT_SHADER);
25 // Write array bounds clamping emulation if needed.
26 getArrayBoundsClamper().OutputClampingFunctionDefinition(sink);
28 // Write translated shader.
29 TOutputESSL outputESSL(sink, getArrayIndexClampingStrategy(), getHashFunction(), getNameMap(), getSymbolTable());
30 root->traverse(&outputESSL);
31 }
33 void TranslatorESSL::writeExtensionBehavior() {
34 TInfoSinkBase& sink = getInfoSink().obj;
35 const TExtensionBehavior& extensionBehavior = getExtensionBehavior();
36 for (TExtensionBehavior::const_iterator iter = extensionBehavior.begin();
37 iter != extensionBehavior.end(); ++iter) {
38 if (iter->second != EBhUndefined) {
39 sink << "#extension " << iter->first << " : "
40 << getBehaviorString(iter->second) << "\n";
41 }
42 }
43 }