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

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

Issue 2863763003: Remove EventSender from ImageLoader (Closed)
Patch Set: fix tests 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
Index: third_party/WebKit/Source/core/loader/ImageLoader.h
diff --git a/third_party/WebKit/Source/core/loader/ImageLoader.h b/third_party/WebKit/Source/core/loader/ImageLoader.h
index 250faa8d02e0caf35cc0cd8755f34226ab658d01..d980e4c40af799d68df928df47b0ba04c4c6c8bd 100644
--- a/third_party/WebKit/Source/core/loader/ImageLoader.h
+++ b/third_party/WebKit/Source/core/loader/ImageLoader.h
@@ -25,6 +25,7 @@
#include <memory>
#include "core/CoreExport.h"
+#include "core/dom/TaskRunnerHelper.h"
#include "core/loader/resource/ImageResource.h"
#include "core/loader/resource/ImageResourceContent.h"
#include "core/loader/resource/ImageResourceObserver.h"
@@ -40,10 +41,6 @@ class Element;
class ImageLoader;
class LayoutImageResource;
-template <typename T>
-class EventSender;
-using ImageEventSender = EventSender<ImageLoader>;
-
class CORE_EXPORT ImageLoader : public GarbageCollectedFinalized<ImageLoader>,
public ImageResourceObserver {
USING_PRE_FINALIZER(ImageLoader, Dispose);
@@ -96,19 +93,14 @@ class CORE_EXPORT ImageLoader : public GarbageCollectedFinalized<ImageLoader>,
void SetLoadingImageDocument() { loading_image_document_ = true; }
bool HasPendingActivity() const {
- return (image_ && !image_complete_) || has_pending_load_event_ ||
- has_pending_error_event_ || pending_task_;
+ return (image_ && !image_complete_) || pending_load_event_.IsActive() ||
+ pending_error_event_.IsActive() || pending_task_;
}
- bool HasPendingError() const { return has_pending_error_event_; }
+ bool HasPendingError() const { return pending_error_event_.IsActive(); }
bool HadError() const { return !failed_load_url_.IsEmpty(); }
- void DispatchPendingEvent(ImageEventSender*);
-
- static void DispatchPendingLoadEvents();
- static void DispatchPendingErrorEvents();
-
bool GetImageAnimationPolicy(ImageAnimationPolicy&) final;
protected:
@@ -129,8 +121,8 @@ class CORE_EXPORT ImageLoader : public GarbageCollectedFinalized<ImageLoader>,
void UpdatedHasPendingEvent();
- void DispatchPendingLoadEvent();
- void DispatchPendingErrorEvent();
+ void DispatchPendingLoadEvent(std::unique_ptr<IncrementLoadEventDelayCount>);
+ void DispatchPendingErrorEvent(std::unique_ptr<IncrementLoadEventDelayCount>);
LayoutImageResource* GetLayoutImageResource();
void UpdateLayoutObject();
@@ -187,8 +179,9 @@ class CORE_EXPORT ImageLoader : public GarbageCollectedFinalized<ImageLoader>,
std::unique_ptr<IncrementLoadEventDelayCount>
delay_until_image_notify_finished_;
- bool has_pending_load_event_ : 1;
- bool has_pending_error_event_ : 1;
+ TaskHandle pending_load_event_;
+ TaskHandle pending_error_event_;
+
bool image_complete_ : 1;
bool loading_image_document_ : 1;
bool element_is_protected_ : 1;

Powered by Google App Engine
This is Rietveld 408576698