Chromium Code Reviews| Index: third_party/WebKit/Source/core/fetch/ImageResource.h |
| diff --git a/third_party/WebKit/Source/core/fetch/ImageResource.h b/third_party/WebKit/Source/core/fetch/ImageResource.h |
| index 0b6ce755fef7bfc9ae4aae1cbed26dad0bc989e8..0a97174e959c86ce2a43a7c4ec9d38c5cd876e63 100644 |
| --- a/third_party/WebKit/Source/core/fetch/ImageResource.h |
| +++ b/third_party/WebKit/Source/core/fetch/ImageResource.h |
| @@ -24,6 +24,7 @@ |
| #define ImageResource_h |
| #include "core/CoreExport.h" |
| +#include "core/fetch/MultipartImageResourceParser.h" |
| #include "core/fetch/Resource.h" |
| #include "platform/geometry/IntRect.h" |
| #include "platform/geometry/IntSizeHash.h" |
| @@ -42,7 +43,7 @@ class Length; |
| class MemoryCache; |
| class SecurityOrigin; |
| -class CORE_EXPORT ImageResource final : public Resource, public ImageObserver { |
| +class CORE_EXPORT ImageResource final : public Resource, public ImageObserver, public MultipartImageResourceParser::Client { |
| friend class MemoryCache; |
| WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ImageResource); |
| public: |
| @@ -96,14 +97,17 @@ public: |
| // the Lo-Fi state set to off and bypassing the cache. |
| void reloadIfLoFi(ResourceFetcher*); |
| + bool isMultipartImage() const { return m_multipartParser; } |
|
hiroshige
2016/02/26 19:03:35
nit optional: I think this corresponds to loadingM
yhirano
2016/02/27 02:03:20
The original name contained "loading" and the impl
|
| + |
| void didAddClient(ResourceClient*) override; |
| void didRemoveClient(ResourceClient*) override; |
| void allClientsRemoved() override; |
| + void appendData(const char*, size_t) override; |
| void error(Resource::Status) override; |
| void responseReceived(const ResourceResponse&, PassOwnPtr<WebDataConsumerHandle>) override; |
| - void finishOnePart() override; |
| + void finish() override; |
| // For compatibility, images keep loading even if there are HTTP errors. |
| bool shouldIgnoreHTTPStatusCodeErrors() const override { return true; } |
| @@ -119,6 +123,10 @@ public: |
| void animationAdvanced(const blink::Image*) override; |
| void changedInRect(const blink::Image*, const IntRect&) override; |
| + // MultipartImageResourceParser::Client |
| + void didReceiveResponse(const ResourceResponse&, bool isFirstPart) final; |
| + void didReceiveData(const char*, size_t) final; |
| + |
| DECLARE_VIRTUAL_TRACE(); |
| protected: |
| @@ -142,7 +150,6 @@ private: |
| }; |
| ImageResource(const ResourceRequest&); |
| - void appendDataInternal(const char*, size_t) override; |
| void clear(); |
| void setCustomAcceptHeader(); |
| @@ -151,10 +158,10 @@ private: |
| void clearImage(); |
| // If not null, changeRect is the changed part of the image. |
| void notifyObservers(const IntRect* changeRect = nullptr); |
| - bool loadingMultipartContent() const; |
| float m_devicePixelRatioHeaderValue; |
| + PersistentWillBeMember<MultipartImageResourceParser> m_multipartParser; |
| RefPtr<blink::Image> m_image; |
| bool m_hasDevicePixelRatioHeaderValue; |
| }; |