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

Side by Side Diff: third_party/WebKit/Source/core/loader/ImageLoader.h

Issue 1844603002: Make ImageLoader non-ResourceClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2004, 2009 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2009 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 26 matching lines...) Expand all
37 class IncrementLoadEventDelayCount; 37 class IncrementLoadEventDelayCount;
38 class FetchRequest; 38 class FetchRequest;
39 class Document; 39 class Document;
40 class Element; 40 class Element;
41 class ImageLoader; 41 class ImageLoader;
42 class LayoutImageResource; 42 class LayoutImageResource;
43 43
44 template<typename T> class EventSender; 44 template<typename T> class EventSender;
45 using ImageEventSender = EventSender<ImageLoader>; 45 using ImageEventSender = EventSender<ImageLoader>;
46 46
47 class CORE_EXPORT ImageLoader : public GarbageCollectedFinalized<ImageLoader>, p ublic ResourceClient, public ImageResourceObserver { 47 class CORE_EXPORT ImageLoader : public GarbageCollectedFinalized<ImageLoader>, p ublic ImageResourceObserver {
48 USING_PRE_FINALIZER(ImageLoader, dispose); 48 USING_PRE_FINALIZER(ImageLoader, dispose);
49 public: 49 public:
50 explicit ImageLoader(Element*); 50 explicit ImageLoader(Element*);
51 ~ImageLoader() override; 51 ~ImageLoader() override;
52 52
53 DECLARE_TRACE(); 53 DECLARE_TRACE();
54 54
55 enum UpdateFromElementBehavior { 55 enum UpdateFromElementBehavior {
56 // This should be the update behavior when the element is attached to a document, or when DOM mutations trigger a new load. 56 // This should be the update behavior when the element is attached to a document, or when DOM mutations trigger a new load.
57 // Starts loading if a load hasn't already been started. 57 // Starts loading if a load hasn't already been started.
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 return m_hasPendingErrorEvent; 96 return m_hasPendingErrorEvent;
97 } 97 }
98 98
99 void dispatchPendingEvent(ImageEventSender*); 99 void dispatchPendingEvent(ImageEventSender*);
100 100
101 static void dispatchPendingLoadEvents(); 101 static void dispatchPendingLoadEvents();
102 static void dispatchPendingErrorEvents(); 102 static void dispatchPendingErrorEvents();
103 103
104 bool getImageAnimationPolicy(ImageAnimationPolicy&) final; 104 bool getImageAnimationPolicy(ImageAnimationPolicy&) final;
105 protected: 105 protected:
106 void notifyFinished(Resource*) override; 106 void imageNotifyFinished(ImageResource*) override;
107 107
108 private: 108 private:
109 class Task; 109 class Task;
110 110
111 // Called from the task or from updateFromElement to initiate the load. 111 // Called from the task or from updateFromElement to initiate the load.
112 void doUpdateFromElement(BypassMainWorldBehavior, UpdateFromElementBehavior, ReferrerPolicy = ReferrerPolicyDefault); 112 void doUpdateFromElement(BypassMainWorldBehavior, UpdateFromElementBehavior, ReferrerPolicy = ReferrerPolicyDefault);
113 113
114 virtual void dispatchLoadEvent() = 0; 114 virtual void dispatchLoadEvent() = 0;
115 virtual void noImageResourceToLoad() { } 115 virtual void noImageResourceToLoad() { }
116 116
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 bool m_hasPendingErrorEvent : 1; 158 bool m_hasPendingErrorEvent : 1;
159 bool m_imageComplete : 1; 159 bool m_imageComplete : 1;
160 bool m_loadingImageDocument : 1; 160 bool m_loadingImageDocument : 1;
161 bool m_elementIsProtected : 1; 161 bool m_elementIsProtected : 1;
162 bool m_suppressErrorEvents : 1; 162 bool m_suppressErrorEvents : 1;
163 }; 163 };
164 164
165 } // namespace blink 165 } // namespace blink
166 166
167 #endif 167 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLImageLoader.cpp ('k') | third_party/WebKit/Source/core/loader/ImageLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698