Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
michael@0 | 1 | From: Jeff Gilbert <jgilbert@mozilla.com> |
michael@0 | 2 | |
michael@0 | 3 | diff --git a/gfx/angle/src/compiler/Compiler.cpp b/gfx/angle/src/compiler/Compiler.cpp |
michael@0 | 4 | --- a/gfx/angle/src/compiler/Compiler.cpp |
michael@0 | 5 | +++ b/gfx/angle/src/compiler/Compiler.cpp |
michael@0 | 6 | @@ -130,18 +130,21 @@ bool TCompiler::Init(const ShBuiltInReso |
michael@0 | 7 | TScopedPoolAllocator scopedAlloc(&allocator, false); |
michael@0 | 8 | |
michael@0 | 9 | // Generate built-in symbol table. |
michael@0 | 10 | if (!InitBuiltInSymbolTable(resources)) |
michael@0 | 11 | return false; |
michael@0 | 12 | InitExtensionBehavior(resources, extensionBehavior); |
michael@0 | 13 | fragmentPrecisionHigh = resources.FragmentPrecisionHigh == 1; |
michael@0 | 14 | |
michael@0 | 15 | - arrayBoundsClamper.SetClampingStrategy(resources.ArrayIndexClampingStrategy); |
michael@0 | 16 | - clampingStrategy = resources.ArrayIndexClampingStrategy; |
michael@0 | 17 | + // ArrayIndexClampingStrategy's enum starts at 1, so 0 is 'default'. |
michael@0 | 18 | + if (resources.ArrayIndexClampingStrategy) { |
michael@0 | 19 | + clampingStrategy = resources.ArrayIndexClampingStrategy; |
michael@0 | 20 | + } |
michael@0 | 21 | + arrayBoundsClamper.SetClampingStrategy(clampingStrategy); |
michael@0 | 22 | |
michael@0 | 23 | hashFunction = resources.HashFunction; |
michael@0 | 24 | |
michael@0 | 25 | return true; |
michael@0 | 26 | } |
michael@0 | 27 | |
michael@0 | 28 | bool TCompiler::compile(const char* const shaderStrings[], |
michael@0 | 29 | size_t numStrings, |
michael@0 | 30 | diff --git a/gfx/angle/src/third_party/compiler/ArrayBoundsClamper.cpp b/gfx/angle/src/third_party/compiler/ArrayBoundsClamper.cpp |
michael@0 | 31 | --- a/gfx/angle/src/third_party/compiler/ArrayBoundsClamper.cpp |
michael@0 | 32 | +++ b/gfx/angle/src/third_party/compiler/ArrayBoundsClamper.cpp |
michael@0 | 33 | @@ -72,16 +72,19 @@ private: |
michael@0 | 34 | ArrayBoundsClamper::ArrayBoundsClamper() |
michael@0 | 35 | : mClampingStrategy(SH_CLAMP_WITH_CLAMP_INTRINSIC) |
michael@0 | 36 | , mArrayBoundsClampDefinitionNeeded(false) |
michael@0 | 37 | { |
michael@0 | 38 | } |
michael@0 | 39 | |
michael@0 | 40 | void ArrayBoundsClamper::SetClampingStrategy(ShArrayIndexClampingStrategy clampingStrategy) |
michael@0 | 41 | { |
michael@0 | 42 | + ASSERT(clampingStrategy == SH_CLAMP_WITH_CLAMP_INTRINSIC || |
michael@0 | 43 | + clampingStrategy == SH_CLAMP_WITH_USER_DEFINED_INT_CLAMP_FUNCTION); |
michael@0 | 44 | + |
michael@0 | 45 | mClampingStrategy = clampingStrategy; |
michael@0 | 46 | } |
michael@0 | 47 | |
michael@0 | 48 | void ArrayBoundsClamper::MarkIndirectArrayBoundsForClamping(TIntermNode* root) |
michael@0 | 49 | { |
michael@0 | 50 | ASSERT(root); |
michael@0 | 51 | |
michael@0 | 52 | ArrayBoundsClamperMarker clamper; |