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

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: 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..7984c89172609c4d29db81748d3f321b46f1ec5b 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_multi_part = !!multipart_parser_;
vmpstr 2017/06/16 17:35:36 everything else is called multipart, so maybe this
Khushal 2017/06/16 18:26:33 Done.
// 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_multi_part);
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_multi_part = !!multipart_parser_;
+ auto result = GetContent()->UpdateImage(std::move(shared_buffer), GetStatus(),
+ update_image_option,
+ all_data_received, is_multi_part);
if (result == ImageResourceContent::UpdateImageResult::kShouldDecodeError) {
// In case of decode error, we call imageNotifyFinished() iff we don't
// initiate reloading:

Powered by Google App Engine
This is Rietveld 408576698