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

Unified Diff: third_party/WebKit/Source/core/loader/ImageLoader.cpp

Issue 2878263002: Revert of Add CHECK()s about ImageLoader::has_pending_load_event_ (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b0fc819f4cbcb87768ad6e22b8d81b104fe5ecb9..74f02520228e0228d8772d8930f9f31b99fff916 100644
--- a/third_party/WebKit/Source/core/loader/ImageLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/ImageLoader.cpp
@@ -519,16 +519,6 @@
DCHECK(failed_load_url_.IsEmpty());
DCHECK_EQ(resource, image_.Get());
- // |has_pending_load_event_| is always false and |image_complete_| is
- // always true for entire ImageDocument loading for historical reason.
- // DoUpdateFromElement() is not called and SetImageForImageDocument()
- // is called instead for ImageDocument loading.
- // TODO(hiroshige): Turn the CHECK()s to DCHECK()s before going to beta.
- if (loading_image_document_)
- CHECK(image_complete_);
- else
- CHECK(!image_complete_);
-
image_complete_ = true;
// Update ImageAnimationPolicy for image_.
@@ -541,12 +531,8 @@
ToSVGImage(image_->GetImage())
->UpdateUseCounters(GetElement()->GetDocument());
- if (loading_image_document_) {
- CHECK(!has_pending_load_event_);
- return;
- }
-
- CHECK(has_pending_load_event_);
+ if (!has_pending_load_event_)
+ return;
if (resource->ErrorOccurred()) {
LoadEventSender().CancelEvent(this);
@@ -646,10 +632,10 @@
}
void ImageLoader::DispatchPendingLoadEvent() {
- CHECK(has_pending_load_event_);
+ if (!has_pending_load_event_)
+ return;
if (!image_)
return;
- CHECK(image_complete_);
has_pending_load_event_ = false;
if (GetElement()->GetDocument().GetFrame())
DispatchLoadEvent();
@@ -661,7 +647,8 @@
}
void ImageLoader::DispatchPendingErrorEvent() {
- CHECK(has_pending_error_event_);
+ if (!has_pending_error_event_)
+ return;
has_pending_error_event_ = false;
if (GetElement()->GetDocument().GetFrame())
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698