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

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

Issue 2903773002: Revert of Remove EventSender from ImageLoader (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
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 0a55829db4e574f61f3eab76067adf46ab5b8642..175b8c6d99bb4bd15238628ebd8d7a1198cace0a 100644
--- a/third_party/WebKit/Source/core/loader/ImageLoader.h
+++ b/third_party/WebKit/Source/core/loader/ImageLoader.h
@@ -25,7 +25,6 @@
#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,6 +39,10 @@
class Element;
class ImageLoader;
class LayoutImageResource;
+
+template <typename T>
+class EventSender;
+using ImageEventSender = EventSender<ImageLoader>;
class CORE_EXPORT ImageLoader : public GarbageCollectedFinalized<ImageLoader>,
public ImageResourceObserver {
@@ -109,9 +112,14 @@
bool HasPendingActivity() const { return HasPendingEvent() || pending_task_; }
- bool HasPendingError() const { return pending_error_event_.IsActive(); }
+ bool HasPendingError() const { return has_pending_error_event_; }
bool HadError() const { return !failed_load_url_.IsEmpty(); }
+
+ void DispatchPendingEvent(ImageEventSender*);
+
+ static void DispatchPendingLoadEvents();
+ static void DispatchPendingErrorEvents();
bool GetImageAnimationPolicy(ImageAnimationPolicy&) final;
@@ -134,8 +142,8 @@
bool HasPendingEvent() const;
void UpdatedHasPendingEvent();
- void DispatchPendingLoadEvent(std::unique_ptr<IncrementLoadEventDelayCount>);
- void DispatchPendingErrorEvent(std::unique_ptr<IncrementLoadEventDelayCount>);
+ void DispatchPendingLoadEvent();
+ void DispatchPendingErrorEvent();
LayoutImageResource* GetLayoutImageResource();
void UpdateLayoutObject();
@@ -198,8 +206,10 @@
std::unique_ptr<IncrementLoadEventDelayCount>
delay_until_image_notify_finished_;
- TaskHandle pending_load_event_;
- TaskHandle pending_error_event_;
+ // Indicates whether there is a pending task for the load/error event on
+ // EventSender. Will be replaced when EventSender is removed crbug/624697.
+ bool has_pending_load_event_ : 1;
+ bool has_pending_error_event_ : 1;
bool image_complete_ : 1;
bool loading_image_document_ : 1;
« no previous file with comments | « third_party/WebKit/Source/core/events/EventSender.h ('k') | third_party/WebKit/Source/core/loader/ImageLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698