Index: Source/core/fetch/ResourceLoadPriorityOptimizer.h |
diff --git a/Source/core/dom/DocumentLifecycle.h b/Source/core/fetch/ResourceLoadPriorityOptimizer.h |
similarity index 67% |
copy from Source/core/dom/DocumentLifecycle.h |
copy to Source/core/fetch/ResourceLoadPriorityOptimizer.h |
index c3f919635e833a43521a5a7e401602671935c4f6..e2da705c185f804a23a66f412d921f5abbce4ad6 100644 |
--- a/Source/core/dom/DocumentLifecycle.h |
+++ b/Source/core/fetch/ResourceLoadPriorityOptimizer.h |
@@ -28,34 +28,36 @@ |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#ifndef DocumentLifecycle_h |
-#define DocumentLifecycle_h |
+#ifndef ResourceLoadPriorityOptimizer_h |
+#define ResourceLoadPriorityOptimizer_h |
-#include "wtf/Noncopyable.h" |
+#include "core/fetch/ImageResource.h" |
+#include "core/fetch/ResourcePtr.h" |
+ |
+#include <map> |
namespace WebCore { |
-class DocumentLifecycle { |
- WTF_MAKE_NONCOPYABLE(DocumentLifecycle); |
+class ResourceLoadPriorityOptimizer { |
public: |
- enum State { |
- Uninitialized, |
- Inactive, |
- Active, |
- Stopping, |
- Stopped, |
- Disposed, |
- }; |
- |
- DocumentLifecycle(); |
- ~DocumentLifecycle(); |
+ ResourceLoadPriorityOptimizer(); |
+ ~ResourceLoadPriorityOptimizer(); |
+ void notifyImageResourceVisibility(ImageResource*, bool); |
eseidel
2013/11/25 23:59:30
Bools make awful args. We try to use Enums when p
shatch
2013/11/26 01:35:18
Done.
|
- State state() const { return m_state; } |
+private: |
+ void updateImageResourcesWithLoadPriority(); |
- void advanceTo(State); |
+ struct ResourceAndVisibility { |
+ ResourceAndVisibility(ImageResource*, bool); |
+ ResourceAndVisibility(); |
+ ResourceAndVisibility(const ResourceAndVisibility&); |
+ ~ResourceAndVisibility(); |
+ ResourcePtr<ImageResource> imageResource; |
+ bool visible; |
+ }; |
-private: |
- State m_state; |
+ typedef std::map<unsigned long, ResourceAndVisibility> ImageResourceMap; |
eseidel
2013/11/25 23:59:30
I don't recall. Is "unsigned long" actually diffe
shatch
2013/11/26 01:35:18
I'm not sure if they're different? A quick search
|
+ ImageResourceMap m_imageResources; |
}; |
} |