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

Unified Diff: third_party/WebKit/Source/core/fetch/FetchRequest.h

Issue 2423683002: Add Blink support for showing image placeholders using range requests. (Closed)
Patch Set: Change test data to "const unsigned char" instead of "const char" to fix warnings in windows build Created 4 years, 2 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/fetch/FetchRequest.h
diff --git a/third_party/WebKit/Source/core/fetch/FetchRequest.h b/third_party/WebKit/Source/core/fetch/FetchRequest.h
index 93c26cfddf0ab562714c1ca99c15779a4ac6a2b8..35fc57556031f3c80b3e72f88efc5eecf5d60555 100644
--- a/third_party/WebKit/Source/core/fetch/FetchRequest.h
+++ b/third_party/WebKit/Source/core/fetch/FetchRequest.h
@@ -49,6 +49,10 @@ class CORE_EXPORT FetchRequest {
RestrictToSameOrigin,
NoOriginRestriction
};
+ enum PlaceholderImageRequestType {
+ DisallowPlaceholder = 0, // The requested image must not be a placeholder.
+ AllowPlaceholder, // The image is allowed to be a placeholder.
+ };
struct ResourceWidth {
DISALLOW_NEW();
@@ -123,6 +127,16 @@ class CORE_EXPORT FetchRequest {
void makeSynchronous();
+ PlaceholderImageRequestType placeholderImageRequestType() const {
+ return m_placeholderImageRequestType;
+ }
+
+ // Configures the request to load an image placeholder if the request is
+ // eligible (e.g. the url's protocol is HTTP, etc.). If this request is
+ // non-eligible, this method doesn't modify the ResourceRequest. Calling this
+ // method sets m_placeholderImageRequestType to the appropriate value.
+ void setAllowImagePlaceholder();
+
private:
ResourceRequest m_resourceRequest;
String m_charset;
@@ -134,6 +148,7 @@ class CORE_EXPORT FetchRequest {
OriginRestriction m_originRestriction;
ResourceWidth m_resourceWidth;
ClientHintsPreferences m_clientHintPreferences;
+ PlaceholderImageRequestType m_placeholderImageRequestType;
};
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSImageValue.cpp ('k') | third_party/WebKit/Source/core/fetch/FetchRequest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698