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..ac44775ca205d1e328eab9989256218b349d8fba 100644 |
--- a/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h |
+++ b/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h |
@@ -93,15 +93,28 @@ 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. |
+ // 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 |
yhirano
2017/05/08 05:28:51
CamelCase
hiroshige
2017/05/08 17:08:14
Done.
|
+ // ImageResource::getStatus(). Use ImageResourceContent::getContentStatus(). |
kouhei (in TOK)
2017/05/08 05:36:22
I'd also add link to https://docs.google.com/docum
hiroshige
2017/05/08 17:08:14
Done.
|
+ 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 +155,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 +193,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 +202,7 @@ class CORE_EXPORT ImageResourceContent final |
}; |
Member<ImageResourceInfo> info_; |
+ ResourceStatus content_status_ = ResourceStatus::kNotStarted; |
RefPtr<blink::Image> image_; |