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

Unified Diff: Source/core/fetch/ClientHintsPreferences.cpp

Issue 1183233002: Split RW hint into Width and Viewport-Width (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed and added layout tests Created 5 years, 6 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
« no previous file with comments | « Source/core/fetch/ClientHintsPreferences.h ('k') | Source/core/fetch/ClientHintsPreferencesTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/ClientHintsPreferences.cpp
diff --git a/Source/core/fetch/ClientHintsPreferences.cpp b/Source/core/fetch/ClientHintsPreferences.cpp
index 266995fb33e98975d5fc667a619ff31bea49d9da..1f4c25e0e4f9103d64fc2b3b023b902629513ed6 100644
--- a/Source/core/fetch/ClientHintsPreferences.cpp
+++ b/Source/core/fetch/ClientHintsPreferences.cpp
@@ -12,14 +12,18 @@ namespace blink {
void handleAcceptClientHintsHeader(const String& headerValue, ClientHintsPreferences& preferences)
{
- if (RuntimeEnabledFeatures::clientHintsEnabled()) {
- CommaDelimitedHeaderSet acceptCH;
- parseCommaDelimitedHeader(headerValue, acceptCH);
- if (acceptCH.contains("dpr"))
- preferences.setShouldSendDPR(true);
- if (acceptCH.contains("rw"))
- preferences.setShouldSendRW(true);
- }
+ if (!RuntimeEnabledFeatures::clientHintsEnabled() || headerValue.isEmpty())
+ return;
+ CommaDelimitedHeaderSet acceptCH;
+ parseCommaDelimitedHeader(headerValue, acceptCH);
+ if (acceptCH.contains("dpr"))
+ preferences.setShouldSendDPR(true);
+
+ if (acceptCH.contains("width"))
+ preferences.setShouldSendResourceWidth(true);
+
+ if (acceptCH.contains("viewport-width"))
+ preferences.setShouldSendViewportWidth(true);
}
}
« no previous file with comments | « Source/core/fetch/ClientHintsPreferences.h ('k') | Source/core/fetch/ClientHintsPreferencesTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698