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

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

Issue 951303003: Added basic client hints support. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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: Source/core/fetch/Resource.cpp
diff --git a/Source/core/fetch/Resource.cpp b/Source/core/fetch/Resource.cpp
index 63f7bf6dc8785eadfd0a034e928c96748e26e681..753cea2524f08e80efa3af4744640ab2ef6af531 100644
--- a/Source/core/fetch/Resource.cpp
+++ b/Source/core/fetch/Resource.cpp
@@ -444,6 +444,14 @@ void Resource::responseReceived(const ResourceResponse& response, PassOwnPtr<Web
ResourceFetcher* fetcher = ResourceFetcher::toResourceFetcher(m_loader->host());
if (fetcher && fetcher->frame()) {
LinkLoader::loadLinkFromHeader(response.httpHeaderField("Link"), fetcher->frame()->document());
+ if (RuntimeEnabledFeatures::clientHintsEnabled() && type() == Resource::MainResource) {
+ String acceptCH = response.httpHeaderField("accept-ch").lower();
+ // FIXME: Write an actual parser for this comma delimited header.
Mike West 2015/02/25 09:03:14 Nit: Can you add a bug ID here? When you add an a
+ if (acceptCH.contains("dpr"))
+ fetcher->frame()->setShouldSendDPRHint();
+ if (acceptCH.contains("rw"))
+ fetcher->frame()->setShouldSendRWHint();
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698