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

Unified Diff: third_party/WebKit/Source/core/html/HTMLImageElement.h

Issue 2769823002: Add decode() functionality to image elements. (Closed)
Patch Set: rebase + update Created 3 years, 7 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/html/HTMLImageElement.h
diff --git a/third_party/WebKit/Source/core/html/HTMLImageElement.h b/third_party/WebKit/Source/core/html/HTMLImageElement.h
index 429a0bce4a9a1c7c432e2ce95b4f6a2681267d84..3e1c6529450bef44b6326ae63623634ec2b89836 100644
--- a/third_party/WebKit/Source/core/html/HTMLImageElement.h
+++ b/third_party/WebKit/Source/core/html/HTMLImageElement.h
@@ -31,6 +31,7 @@
#include "core/html/canvas/ImageElementBase.h"
#include "platform/bindings/ActiveScriptWrappable.h"
#include "platform/graphics/GraphicsTypes.h"
+#include "platform/heap/HeapAllocator.h"
#include "platform/loader/fetch/FetchParameters.h"
#include "platform/loader/fetch/ResourceResponse.h"
@@ -99,6 +100,8 @@ class CORE_EXPORT HTMLImageElement final
int x() const;
int y() const;
+ ScriptPromise decode(ScriptState*, ExceptionState&);
+
bool complete() const;
bool HasPendingActivity() const final {
@@ -133,6 +136,8 @@ class CORE_EXPORT HTMLImageElement final
FormAssociated* ToFormAssociatedOrNull() override { return this; };
void AssociateWith(HTMLFormElement*) override;
+ void ImageNotifyFinished(bool success);
+
protected:
// Controls how an image element appears in the layout. See:
// https://html.spec.whatwg.org/multipage/embedded-content.html#image-request
@@ -185,6 +190,9 @@ class CORE_EXPORT HTMLImageElement final
bool IsInteractiveContent() const override;
Image* ImageContents() override;
+ void RequestDecode();
+ void DidDecode(uint32_t sequence_id, bool success);
pdr. 2017/05/18 03:20:10 Can you add some short comments here and above Req
vmpstr 2017/05/18 18:51:13 Done.
+
void ResetFormOwner();
ImageCandidate FindBestFitImageFromPictureParent();
void SetBestFitURLAndDPRFromImageCandidate(const ImageCandidate&);
@@ -199,6 +207,8 @@ class CORE_EXPORT HTMLImageElement final
float image_device_pixel_ratio_;
Member<HTMLSourceElement> source_;
LayoutDisposition layout_disposition_;
+ HeapVector<Member<ScriptPromiseResolver>> decode_promise_resolvers_;
+ uint32_t decode_sequence_id_;
unsigned form_was_set_by_parser_ : 1;
unsigned element_created_by_parser_ : 1;
unsigned is_fallback_image_ : 1;

Powered by Google App Engine
This is Rietveld 408576698