Index: third_party/WebKit/Source/core/loader/ImageLoader.cpp |
diff --git a/third_party/WebKit/Source/core/loader/ImageLoader.cpp b/third_party/WebKit/Source/core/loader/ImageLoader.cpp |
index 6009426ade2710d17bf7552ab58d6ac0692e1096..efb2bde0845ca1dad5712bc41534ff1f914726d1 100644 |
--- a/third_party/WebKit/Source/core/loader/ImageLoader.cpp |
+++ b/third_party/WebKit/Source/core/loader/ImageLoader.cpp |
@@ -496,6 +496,12 @@ void ImageLoader::ImageNotifyFinished(ImageResourceContent* resource) { |
DCHECK(failed_load_url_.IsEmpty()); |
DCHECK_EQ(resource, image_.Get()); |
+ if (loading_image_document_) { |
+ CHECK(image_complete_); |
+ } else { |
+ CHECK(!image_complete_); |
+ } |
kinuko
2017/05/08 05:34:34
nit: no braces for one-block line for consistency
hiroshige
2017/05/08 18:56:42
Done.
|
+ |
image_complete_ = true; |
delay_until_image_notify_finished_ = nullptr; |
@@ -509,8 +515,12 @@ void ImageLoader::ImageNotifyFinished(ImageResourceContent* resource) { |
ToSVGImage(image_->GetImage()) |
->UpdateUseCounters(GetElement()->GetDocument()); |
- if (!has_pending_load_event_) |
+ if (loading_image_document_) { |
+ CHECK(!has_pending_load_event_); |
return; |
+ } |
+ |
+ CHECK(has_pending_load_event_); |
if (resource->ErrorOccurred()) { |
LoadEventSender().CancelEvent(this); |
@@ -610,10 +620,10 @@ void ImageLoader::DispatchPendingEvent(ImageEventSender* event_sender) { |
} |
void ImageLoader::DispatchPendingLoadEvent() { |
- if (!has_pending_load_event_) |
- return; |
+ CHECK(has_pending_load_event_); |
if (!image_) |
return; |
+ CHECK(image_complete_); |
has_pending_load_event_ = false; |
if (GetElement()->GetDocument().GetFrame()) |
DispatchLoadEvent(); |