Skip to content

Commit

Permalink
Bug 1378375 - Kill switch preference for image network request priori…
Browse files Browse the repository at this point in the history
…tization according layout position. r=tnikkel
  • Loading branch information
mayhemer committed Jul 14, 2017
1 parent b740820 commit 62ab8fa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions gfx/thebes/gfxPrefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ class gfxPrefs final
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);
Expand Down
4 changes: 4 additions & 0 deletions image/imgRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 4 additions & 0 deletions modules/libpref/init/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down

0 comments on commit 62ab8fa

Please sign in to comment.