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

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

Issue 205523003: Remove beforeload events. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove more tests Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/loader/FrameLoader.cpp ('k') | Source/core/loader/ImageLoader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 // This function should be called whenever the 'src' attribute is set, even if its value 64 // This function should be called whenever the 'src' attribute is set, even if its value
65 // doesn't change; starts new load unconditionally (matches Firefox and Oper a behavior). 65 // doesn't change; starts new load unconditionally (matches Firefox and Oper a behavior).
66 void updateFromElementIgnoringPreviousError(); 66 void updateFromElementIgnoringPreviousError();
67 67
68 void elementDidMoveToNewDocument(); 68 void elementDidMoveToNewDocument();
69 69
70 Element* element() const { return m_element; } 70 Element* element() const { return m_element; }
71 bool imageComplete() const { return m_imageComplete; } 71 bool imageComplete() const { return m_imageComplete; }
72 72
73 ImageResource* image() const { return m_image.get(); } 73 ImageResource* image() const { return m_image.get(); }
74 void setImage(ImageResource*); // Cancels pending beforeload and load events , and doesn't dispatch new ones. 74 void setImage(ImageResource*); // Cancels pending load events, and doesn't d ispatch new ones.
75 75
76 void setLoadManually(bool loadManually) { m_loadManually = loadManually; } 76 void setLoadManually(bool loadManually) { m_loadManually = loadManually; }
77 77
78 bool hasPendingBeforeLoadEvent() const { return m_hasPendingBeforeLoadEvent; }
79 bool hasPendingActivity() const { return m_hasPendingLoadEvent || m_hasPendi ngErrorEvent; } 78 bool hasPendingActivity() const { return m_hasPendingLoadEvent || m_hasPendi ngErrorEvent; }
80 79
81 void dispatchPendingEvent(ImageEventSender*); 80 void dispatchPendingEvent(ImageEventSender*);
82 81
83 static void dispatchPendingBeforeLoadEvents();
84 static void dispatchPendingLoadEvents(); 82 static void dispatchPendingLoadEvents();
85 static void dispatchPendingErrorEvents(); 83 static void dispatchPendingErrorEvents();
86 84
87 void addClient(ImageLoaderClient*); 85 void addClient(ImageLoaderClient*);
88 void removeClient(ImageLoaderClient*); 86 void removeClient(ImageLoaderClient*);
89 87
90 protected: 88 protected:
91 virtual void notifyFinished(Resource*) OVERRIDE; 89 virtual void notifyFinished(Resource*) OVERRIDE;
92 90
93 private: 91 private:
94 virtual void dispatchLoadEvent() = 0; 92 virtual void dispatchLoadEvent() = 0;
95 virtual String sourceURI(const AtomicString&) const = 0; 93 virtual String sourceURI(const AtomicString&) const = 0;
96 94
97 void updatedHasPendingEvent(); 95 void updatedHasPendingEvent();
98 96
99 void dispatchPendingBeforeLoadEvent();
100 void dispatchPendingLoadEvent(); 97 void dispatchPendingLoadEvent();
101 void dispatchPendingErrorEvent(); 98 void dispatchPendingErrorEvent();
102 99
103 RenderImageResource* renderImageResource(); 100 RenderImageResource* renderImageResource();
104 void updateRenderer(); 101 void updateRenderer();
105 102
106 void setImageWithoutConsideringPendingLoadEvent(ImageResource*); 103 void setImageWithoutConsideringPendingLoadEvent(ImageResource*);
107 void sourceImageChanged(); 104 void sourceImageChanged();
108 void clearFailedLoadURL(); 105 void clearFailedLoadURL();
109 106
110 void timerFired(Timer<ImageLoader>*); 107 void timerFired(Timer<ImageLoader>*);
111 108
112 typedef WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<ImageLoaderClient > > ImageLoaderClientSet; 109 typedef WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<ImageLoaderClient > > ImageLoaderClientSet;
113 110
114 Element* m_element; 111 Element* m_element;
115 ResourcePtr<ImageResource> m_image; 112 ResourcePtr<ImageResource> m_image;
116 ImageLoaderClientSet m_clients; 113 ImageLoaderClientSet m_clients;
117 Timer<ImageLoader> m_derefElementTimer; 114 Timer<ImageLoader> m_derefElementTimer;
118 AtomicString m_failedLoadURL; 115 AtomicString m_failedLoadURL;
119 bool m_hasPendingBeforeLoadEvent : 1;
120 bool m_hasPendingLoadEvent : 1; 116 bool m_hasPendingLoadEvent : 1;
121 bool m_hasPendingErrorEvent : 1; 117 bool m_hasPendingErrorEvent : 1;
122 bool m_imageComplete : 1; 118 bool m_imageComplete : 1;
123 bool m_loadManually : 1; 119 bool m_loadManually : 1;
124 bool m_elementIsProtected : 1; 120 bool m_elementIsProtected : 1;
125 unsigned m_highPriorityClientCount; 121 unsigned m_highPriorityClientCount;
126 }; 122 };
127 123
128 } 124 }
129 125
130 #endif 126 #endif
OLDNEW
« no previous file with comments | « Source/core/loader/FrameLoader.cpp ('k') | Source/core/loader/ImageLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698