Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Unified Diff: third_party/WebKit/Source/core/loader/resource/ImageResource.cpp

Issue 2939243002: cc/blink: Veto checker-imaging for multipart image resources. (Closed)
Patch Set: tested Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 2a19d222e787f6c3f67a161f9452d754c963fe4a..20e1aeec8112c42e410bc75b11c9b354f5f8fa38 100644
--- a/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp
+++ b/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp
@@ -342,6 +342,7 @@ void ImageResource::DecodeError(bool all_data_received) {
if (!ErrorOccurred())
SetStatus(ResourceStatus::kDecodeError);
+ bool is_multipart = !!multipart_parser_;
// Finishes loading if needed, and notifies observers.
if (!all_data_received && Loader()) {
// Observers are notified via ImageResource::finish().
@@ -350,7 +351,8 @@ void ImageResource::DecodeError(bool all_data_received) {
} else {
auto result = GetContent()->UpdateImage(
nullptr, GetStatus(),
- ImageResourceContent::kClearImageAndNotifyObservers, all_data_received);
+ ImageResourceContent::kClearImageAndNotifyObservers, all_data_received,
+ is_multipart);
DCHECK_EQ(result, ImageResourceContent::UpdateImageResult::kNoDecodeError);
}
@@ -610,9 +612,10 @@ void ImageResource::UpdateImage(
PassRefPtr<SharedBuffer> shared_buffer,
ImageResourceContent::UpdateImageOption update_image_option,
bool all_data_received) {
- auto result =
- GetContent()->UpdateImage(std::move(shared_buffer), GetStatus(),
- update_image_option, all_data_received);
+ bool is_multipart = !!multipart_parser_;
+ auto result = GetContent()->UpdateImage(std::move(shared_buffer), GetStatus(),
+ update_image_option,
+ all_data_received, is_multipart);
if (result == ImageResourceContent::UpdateImageResult::kShouldDecodeError) {
// In case of decode error, we call imageNotifyFinished() iff we don't
// initiate reloading:
« no previous file with comments | « cc/tiles/checker_image_tracker_unittest.cc ('k') | third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698