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

Side by Side Diff: Source/WebCore/loader/cache/CachedImage.h

Issue 14210003: Simplify CachedResource::data (Closed) Base URL: svn://svn.chromium.org/blink/trunk/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/WebCore/loader/cache/CachedFont.cpp ('k') | Source/WebCore/loader/cache/CachedImage.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) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller <mueller@kde.org> 3 Copyright (C) 2001 Dirk Mueller <mueller@kde.org>
4 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 4 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
5 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 5 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
6 6
7 This library is free software; you can redistribute it and/or 7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public 8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either 9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version. 10 version 2 of the License, or (at your option) any later version.
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 // This method takes a zoom multiplier that can be used to increase the natu ral size of the image by the zoom. 69 // This method takes a zoom multiplier that can be used to increase the natu ral size of the image by the zoom.
70 LayoutSize imageSizeForRenderer(const RenderObject*, float multiplier); // r eturns the size of the complete image. 70 LayoutSize imageSizeForRenderer(const RenderObject*, float multiplier); // r eturns the size of the complete image.
71 void computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHei ght, FloatSize& intrinsicRatio); 71 void computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHei ght, FloatSize& intrinsicRatio);
72 72
73 virtual void didAddClient(CachedResourceClient*); 73 virtual void didAddClient(CachedResourceClient*);
74 virtual void didRemoveClient(CachedResourceClient*); 74 virtual void didRemoveClient(CachedResourceClient*);
75 75
76 virtual void allClientsRemoved(); 76 virtual void allClientsRemoved();
77 virtual void destroyDecodedData(); 77 virtual void destroyDecodedData();
78 78
79 virtual void data(PassRefPtr<ResourceBuffer> data, bool allDataReceived); 79 virtual void data(PassRefPtr<ResourceBuffer> data) OVERRIDE;
80 virtual void error(CachedResource::Status); 80 virtual void error(CachedResource::Status);
81 virtual void responseReceived(const ResourceResponse&); 81 virtual void responseReceived(const ResourceResponse&);
82 virtual void finishOnePart() OVERRIDE;
82 83
83 // For compatibility, images keep loading even if there are HTTP errors. 84 // For compatibility, images keep loading even if there are HTTP errors.
84 virtual bool shouldIgnoreHTTPStatusCodeErrors() const { return true; } 85 virtual bool shouldIgnoreHTTPStatusCodeErrors() const { return true; }
85 86
86 virtual bool isImage() const { return true; } 87 virtual bool isImage() const { return true; }
87 virtual bool stillNeedsLoad() const OVERRIDE { return !errorOccurred() && st atus() == Unknown && !isLoading(); } 88 virtual bool stillNeedsLoad() const OVERRIDE { return !errorOccurred() && st atus() == Unknown && !isLoading(); }
88 89
89 // ImageObserver 90 // ImageObserver
90 virtual void decodedSizeChanged(const Image* image, int delta); 91 virtual void decodedSizeChanged(const Image* image, int delta);
91 virtual void didDraw(const Image*); 92 virtual void didDraw(const Image*);
92 93
93 virtual bool shouldPauseAnimation(const Image*); 94 virtual bool shouldPauseAnimation(const Image*);
94 virtual void animationAdvanced(const Image*); 95 virtual void animationAdvanced(const Image*);
95 virtual void changedInRect(const Image*, const IntRect&); 96 virtual void changedInRect(const Image*, const IntRect&);
96 97
97 virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; 98 virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE;
98 99
99 private: 100 private:
100 void clear(); 101 void clear();
101 102
102 void setCustomAcceptHeader(); 103 void setCustomAcceptHeader();
103 void createImage(); 104 void createImage();
105 void updateImage(bool allDataReceived);
104 void clearImage(); 106 void clearImage();
105 // If not null, changeRect is the changed part of the image. 107 // If not null, changeRect is the changed part of the image.
106 void notifyObservers(const IntRect* changeRect = 0); 108 void notifyObservers(const IntRect* changeRect = 0);
107 virtual PurgePriority purgePriority() const { return PurgeFirst; } 109 virtual PurgePriority purgePriority() const { return PurgeFirst; }
108 110
109 virtual void switchClientsToRevalidatedResource() OVERRIDE; 111 virtual void switchClientsToRevalidatedResource() OVERRIDE;
110 112
111 typedef pair<IntSize, float> SizeAndZoom; 113 typedef pair<IntSize, float> SizeAndZoom;
112 typedef HashMap<const CachedImageClient*, SizeAndZoom> ContainerSizeRequests ; 114 typedef HashMap<const CachedImageClient*, SizeAndZoom> ContainerSizeRequests ;
113 ContainerSizeRequests m_pendingContainerSizeRequests; 115 ContainerSizeRequests m_pendingContainerSizeRequests;
114 116
115 RefPtr<Image> m_image; 117 RefPtr<Image> m_image;
116 #if ENABLE(SVG) 118 #if ENABLE(SVG)
117 OwnPtr<SVGImageCache> m_svgImageCache; 119 OwnPtr<SVGImageCache> m_svgImageCache;
118 #endif 120 #endif
121 bool m_loadingMultipartContent;
119 }; 122 };
120 123
121 } 124 }
122 125
123 #endif 126 #endif
OLDNEW
« no previous file with comments | « Source/WebCore/loader/cache/CachedFont.cpp ('k') | Source/WebCore/loader/cache/CachedImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698