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

Unified Diff: Source/core/loader/FrameFetchContext.cpp

Issue 1121263002: Add Accept-CH meta http-equiv support to the preloader. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review nits Created 5 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
« no previous file with comments | « Source/core/html/parser/PreloadRequest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/FrameFetchContext.cpp
diff --git a/Source/core/loader/FrameFetchContext.cpp b/Source/core/loader/FrameFetchContext.cpp
index 6b686f761440bbb55ef9c4cda26c31079798bd61..2a2f80a4ea303b74a8e5201b98d3f18bd401cf6c 100644
--- a/Source/core/loader/FrameFetchContext.cpp
+++ b/Source/core/loader/FrameFetchContext.cpp
@@ -616,10 +616,13 @@ void FrameFetchContext::addClientHintsIfNecessary(FetchRequest& fetchRequest)
if (!RuntimeEnabledFeatures::clientHintsEnabled() || !m_document)
return;
- if (m_document->clientHintsPreferences().shouldSendDPR())
+ bool shouldSendDPR = m_document->clientHintsPreferences().shouldSendDPR() || fetchRequest.clientHintsPreferences().shouldSendDPR();
+ bool shouldSendRW = m_document->clientHintsPreferences().shouldSendRW() || fetchRequest.clientHintsPreferences().shouldSendRW();
+
+ if (shouldSendDPR)
fetchRequest.mutableResourceRequest().addHTTPHeaderField("DPR", AtomicString(String::number(m_document->devicePixelRatio())));
- if (m_document->clientHintsPreferences().shouldSendRW() && frame()->view()) {
+ if (shouldSendRW && frame()->view()) {
FetchRequest::ResourceWidth resourceWidth = fetchRequest.resourceWidth();
float usedResourceWidth = resourceWidth.isSet ? resourceWidth.width : frame()->view()->viewportWidth();
fetchRequest.mutableResourceRequest().addHTTPHeaderField("RW", AtomicString(String::number(usedResourceWidth)));
« no previous file with comments | « Source/core/html/parser/PreloadRequest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698