mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 23:02:20 +00:00
Bug 1260247. In chaos mode randomly decide to start a new image load even if the image is in the image cache when allowed by spec. r=seth
If the image load is from the same document that cached the image we are required to use the cached version. Otherwise we should be free to ignore the cached version.
This commit is contained in:
parent
1144ba9c95
commit
6aeb6d5d05
@ -8,6 +8,7 @@
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "mozilla/Move.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/ChaosMode.h"
|
||||
|
||||
#include "ImageLogging.h"
|
||||
#include "nsPrintfCString.h"
|
||||
@ -1772,6 +1773,12 @@ imgLoader::ValidateEntry(imgCacheEntry* aEntry,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (MOZ_UNLIKELY(ChaosMode::isActive(ChaosFeature::ImageCache))) {
|
||||
if (ChaosMode::randomUint32LessThan(4) < 1) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Determine whether the cache aEntry must be revalidated...
|
||||
validateRequest = ShouldRevalidateEntry(aEntry, aLoadFlags, hasExpired);
|
||||
|
||||
|
@ -27,6 +27,8 @@ enum ChaosFeature {
|
||||
IOAmounts = 0x8,
|
||||
// Iterate over hash tables in random order.
|
||||
HashTableIteration = 0x10,
|
||||
// Randomly refuse to use cached version of image (when allowed by spec).
|
||||
ImageCache = 0x20,
|
||||
Any = 0xffffffff,
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user