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 78c55b1e26e90eb7f39e005f11c6bef4c2e6abd7..6351b931253d66bdb82d1dbb5af93471842d7295 100644 |
--- a/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h |
+++ b/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h |
@@ -93,15 +93,29 @@ class CORE_EXPORT ImageResourceContent final |
DECLARE_TRACE(); |
- // Redirecting methods to Resource. |
- const KURL& Url() const; |
- bool IsAccessAllowed(SecurityOrigin*); |
- const ResourceResponse& GetResponse() const; |
+ // Content status and deriving predicates. |
+ // https://docs.google.com/document/d/1O-fB83mrE0B_V8gzXNqHgmRLCvstTB4MMi3RnVLr8bE/edit#heading=h.6cyqmir0f30h |
+ // Normal transitions: |
+ // kNotStarted -> kPending -> kCached|kLoadError|kDecodeError. |
+ // Additional transitions in multipart images: |
+ // kCached -> kLoadError|kDecodeError. |
+ // Transitions due to revalidation: |
+ // kCached -> kPending. |
+ // Transitions due to reload: |
+ // kCached|kLoadError|kDecodeError -> kPending. |
+ // |
+ // ImageResourceContent::GetContentStatus() can be different from |
+ // ImageResource::GetStatus(). Use ImageResourceContent::GetContentStatus(). |
+ ResourceStatus GetContentStatus() 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& GetResponse() const; |
const ResourceError& GetResourceError() const; |
// For FrameSerializer. |
@@ -142,9 +156,11 @@ class CORE_EXPORT ImageResourceContent final |
kShouldDecodeError, |
}; |
WARN_UNUSED_RESULT UpdateImageResult UpdateImage(PassRefPtr<SharedBuffer>, |
+ ResourceStatus, |
UpdateImageOption, |
bool all_data_received); |
+ void NotifyStartLoad(); |
void DestroyDecodedData(); |
void DoResetAnimation(); |
@@ -178,6 +194,7 @@ class CORE_EXPORT ImageResourceContent final |
void NotifyObservers(NotifyFinishOption, |
const IntRect* change_rect = nullptr); |
void MarkObserverFinished(ImageResourceObserver*); |
+ void UpdateToLoadedContentStatus(ResourceStatus); |
class ProhibitAddRemoveObserverInScope : public AutoReset<bool> { |
public: |
@@ -186,6 +203,7 @@ class CORE_EXPORT ImageResourceContent final |
}; |
Member<ImageResourceInfo> info_; |
+ ResourceStatus content_status_ = ResourceStatus::kNotStarted; |
RefPtr<blink::Image> image_; |