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

Unified Diff: third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h

Issue 2746343002: Phase III Step 1: Make ImageResourceContent manage its own ResourceStatus (Closed)
Patch Set: Rewind Created 3 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/loader/resource/ImageResourceContent.h
diff --git a/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h b/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h
index 9d6417aebcf6c3fc086ed036a04aa9621fb8df54..e08180023cd7609a974a39f77b29a886c6ef2236 100644
--- a/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h
+++ b/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h
@@ -91,15 +91,19 @@ class CORE_EXPORT ImageResourceContent final
DECLARE_TRACE();
- // Redirecting methods to Resource.
- const KURL& url() const;
- bool isAccessAllowed(SecurityOrigin*);
- const ResourceResponse& response() const;
+ // ResourceStatus and deriving predicates.
+ // ImageResourceContent::getStatus() can be different from
+ // ImageResource::getStatus(). Use ImageResourceContent::getStatus().
+ ResourceStatus getStatus() const;
bool isLoaded() const;
bool isLoading() const;
bool errorOccurred() const;
bool loadFailedOrCanceled() const;
- ResourceStatus getStatus() const;
+
+ // Redirecting methods to Resource.
+ const KURL& url() const;
+ bool isAccessAllowed(SecurityOrigin*);
+ const ResourceResponse& response() const;
const ResourceError& resourceError() const;
// For FrameSerializer.
@@ -140,9 +144,11 @@ class CORE_EXPORT ImageResourceContent final
ShouldDecodeError,
};
WARN_UNUSED_RESULT UpdateImageResult updateImage(PassRefPtr<SharedBuffer>,
+ ResourceStatus,
UpdateImageOption,
bool allDataReceived);
+ void notifyStartLoad();
void destroyDecodedData();
void doResetAnimation();
@@ -175,8 +181,10 @@ class CORE_EXPORT ImageResourceContent final
// If not null, changeRect is the changed part of the image.
void notifyObservers(NotifyFinishOption, const IntRect* changeRect = nullptr);
void markObserverFinished(ImageResourceObserver*);
+ void updateStatus(ResourceStatus, NotifyFinishOption);
Member<ImageResourceInfo> m_info;
+ ResourceStatus m_status = ResourceStatus::NotStarted;
RefPtr<blink::Image> m_image;

Powered by Google App Engine
This is Rietveld 408576698