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

Unified Diff: third_party/WebKit/Source/core/fetch/ImageResource.h

Issue 1710733002: Move multipart resource handling to core/fetch (2/2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@multipart-cleanup
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
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 d05ec2bcd82087a70c96918be32b4bedc7df9b06..353f25b70f064d5216b9229e4f661375fe3f618a 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:
@@ -100,7 +101,7 @@ public:
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; }
@@ -116,6 +117,10 @@ public:
void animationAdvanced(const blink::Image*) override;
void changedInRect(const blink::Image*, const IntRect&) override;
+ // MultipartImageResourceParser::Client
+ void onePartInMultipartReceived(const ResourceResponse&, bool isFirstPart) final;
+ void multipartDataReceived(const char*, size_t) final;
+
DECLARE_VIRTUAL_TRACE();
protected:
@@ -147,10 +152,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;
};
« no previous file with comments | « third_party/WebKit/Source/core/dom/DOMImplementation.cpp ('k') | third_party/WebKit/Source/core/fetch/ImageResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698