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

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

Issue 2769823002: Add decode() functionality to image elements. (Closed)
Patch Set: update 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/html/HTMLImageElement.h
diff --git a/third_party/WebKit/Source/core/html/HTMLImageElement.h b/third_party/WebKit/Source/core/html/HTMLImageElement.h
index f4a5c8c901d8695641345da02626b0bb2929f7e4..6cea32f7aec3f94003495ed58f22686af5762702 100644
--- a/third_party/WebKit/Source/core/html/HTMLImageElement.h
+++ b/third_party/WebKit/Source/core/html/HTMLImageElement.h
@@ -32,6 +32,7 @@
#include "core/html/canvas/CanvasImageElementSource.h"
#include "core/imagebitmap/ImageBitmapSource.h"
#include "platform/graphics/GraphicsTypes.h"
+#include "platform/heap/HeapAllocator.h"
#include "platform/loader/fetch/FetchRequest.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 {
@@ -166,6 +169,8 @@ class CORE_EXPORT HTMLImageElement final
void didAddUserAgentShadowRoot(ShadowRoot&) override;
PassRefPtr<ComputedStyle> customStyleForLayoutObject() override;
+ void defaultEventHandler(Event*) override;
+
private:
bool areAuthorShadowsAllowed() const override { return false; }
@@ -201,6 +206,9 @@ class CORE_EXPORT HTMLImageElement final
void notifyViewportChanged();
void createMediaQueryListIfDoesNotExist();
+ void requestDecode();
+ void didDecode(bool success);
+
Member<HTMLImageLoader> m_imageLoader;
Member<ViewportChangeListener> m_listener;
Member<HTMLFormElement> m_form;
@@ -211,8 +219,11 @@ class CORE_EXPORT HTMLImageElement final
unsigned m_formWasSetByParser : 1;
unsigned m_elementCreatedByParser : 1;
unsigned m_isFallbackImage : 1;
+ HeapVector<Member<ScriptPromiseResolver>> m_decodePromiseResolvers;
ReferrerPolicy m_referrerPolicy;
+
+ WTF::WeakPtrFactory<HTMLImageElement> m_weakPtrFactory;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698