| Index: third_party/WebKit/Source/core/loader/resource/ImageResource.cpp
|
| diff --git a/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp b/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp
|
| index 0537ade286012b5626f6cd80dc25801b246ad731..c5c664d4ceb9389c92184cfe591a4619b93c23a9 100644
|
| --- a/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp
|
| +++ b/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp
|
| @@ -494,7 +494,20 @@ void ImageResource::ReloadIfLoFiOrPlaceholderImage(
|
|
|
| SetCachePolicyBypassingCache();
|
|
|
| - SetPreviewsStateNoTransform();
|
| + // The reloaded image should not use any previews transformations.
|
| + WebURLRequest::PreviewsState previews_state_for_reload =
|
| + WebURLRequest::kPreviewsNoTransform;
|
| +
|
| + if (policy == kReloadIfNeeded && (GetResourceRequest().GetPreviewsState() &
|
| + WebURLRequest::kClientLoFiOn)) {
|
| + // If the image attempted to use Client LoFi, but encountered a decoding
|
| + // error and is being automatically reloaded, then also set the appropriate
|
| + // PreviewsState bit for that. This allows the embedder to count the
|
| + // bandwidth used for this reload against the data savings of the initial
|
| + // response.
|
| + previews_state_for_reload |= WebURLRequest::kClientLoFiAutoReload;
|
| + }
|
| + SetPreviewsState(previews_state_for_reload);
|
|
|
| if (placeholder_option_ != PlaceholderOption::kDoNotReloadPlaceholder)
|
| ClearRangeRequestHeader();
|
|
|