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.
1 From: Jeff Gilbert <jgilbert@mozilla.com>
3 diff --git a/gfx/angle/src/compiler/Compiler.cpp b/gfx/angle/src/compiler/Compiler.cpp
4 --- a/gfx/angle/src/compiler/Compiler.cpp
5 +++ b/gfx/angle/src/compiler/Compiler.cpp
6 @@ -130,18 +130,21 @@ bool TCompiler::Init(const ShBuiltInReso
7 TScopedPoolAllocator scopedAlloc(&allocator, false);
9 // Generate built-in symbol table.
10 if (!InitBuiltInSymbolTable(resources))
11 return false;
12 InitExtensionBehavior(resources, extensionBehavior);
13 fragmentPrecisionHigh = resources.FragmentPrecisionHigh == 1;
15 - arrayBoundsClamper.SetClampingStrategy(resources.ArrayIndexClampingStrategy);
16 - clampingStrategy = resources.ArrayIndexClampingStrategy;
17 + // ArrayIndexClampingStrategy's enum starts at 1, so 0 is 'default'.
18 + if (resources.ArrayIndexClampingStrategy) {
19 + clampingStrategy = resources.ArrayIndexClampingStrategy;
20 + }
21 + arrayBoundsClamper.SetClampingStrategy(clampingStrategy);
23 hashFunction = resources.HashFunction;
25 return true;
26 }
28 bool TCompiler::compile(const char* const shaderStrings[],
29 size_t numStrings,
30 diff --git a/gfx/angle/src/third_party/compiler/ArrayBoundsClamper.cpp b/gfx/angle/src/third_party/compiler/ArrayBoundsClamper.cpp
31 --- a/gfx/angle/src/third_party/compiler/ArrayBoundsClamper.cpp
32 +++ b/gfx/angle/src/third_party/compiler/ArrayBoundsClamper.cpp
33 @@ -72,16 +72,19 @@ private:
34 ArrayBoundsClamper::ArrayBoundsClamper()
35 : mClampingStrategy(SH_CLAMP_WITH_CLAMP_INTRINSIC)
36 , mArrayBoundsClampDefinitionNeeded(false)
37 {
38 }
40 void ArrayBoundsClamper::SetClampingStrategy(ShArrayIndexClampingStrategy clampingStrategy)
41 {
42 + ASSERT(clampingStrategy == SH_CLAMP_WITH_CLAMP_INTRINSIC ||
43 + clampingStrategy == SH_CLAMP_WITH_USER_DEFINED_INT_CLAMP_FUNCTION);
44 +
45 mClampingStrategy = clampingStrategy;
46 }
48 void ArrayBoundsClamper::MarkIndirectArrayBoundsForClamping(TIntermNode* root)
49 {
50 ASSERT(root);
52 ArrayBoundsClamperMarker clamper;