Bug 1378375 - Kill switch preference for image network request prioritization according layout position. r=tnikkel

This commit is contained in:
Honza Bambas 2017-07-14 09:26:00 -04:00
Родитель c7e8c24f9f
Коммит 8f8eed7be6
3 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -501,6 +501,7 @@ private:
DECL_GFX_PREF(Live, "image.decode-immediately.enabled", ImageDecodeImmediatelyEnabled, bool, false);
DECL_GFX_PREF(Live, "image.downscale-during-decode.enabled", ImageDownscaleDuringDecodeEnabled, bool, true);
DECL_GFX_PREF(Live, "image.infer-src-animation.threshold-ms", ImageInferSrcAnimationThresholdMS, uint32_t, 2000);
DECL_GFX_PREF(Live, "image.layout_network_priority", ImageLayoutNetworkPriority, bool, true);
DECL_GFX_PREF(Once, "image.mem.decode_bytes_at_a_time", ImageMemDecodeBytesAtATime, uint32_t, 200000);
DECL_GFX_PREF(Live, "image.mem.discardable", ImageMemDiscardable, bool, false);
DECL_GFX_PREF(Once, "image.mem.animated.discardable", ImageMemAnimatedDiscardable, bool, false);

Просмотреть файл

@ -558,6 +558,10 @@ imgRequest::AdjustPriorityInternal(int32_t aDelta)
void
imgRequest::BoostPriority(uint32_t aCategory)
{
if (!gfxPrefs::ImageLayoutNetworkPriority()) {
return;
}
uint32_t newRequestedCategory =
(mBoostCategoriesRequested & aCategory) ^ aCategory;
if (!newRequestedCategory) {

Просмотреть файл

@ -4604,6 +4604,10 @@ pref("image.http.accept", "*/*");
// disable.
pref("image.infer-src-animation.threshold-ms", 2000);
// Whether the network request priority should be adjusted according
// the layout and view frame position of each particular image.
pref("image.layout_network_priority", true);
//
// Image memory management prefs
//