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

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

Issue 1189523015: Add use-counters for Client-Hints features (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Changed to counting functions 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/loader/FrameFetchContext.h ('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 4996b72f0238e827db2bd0e9c310aa2f95b9e30b..c1dcbe7696a678ee8af3d6a0cc009ccb93c05af6 100644
--- a/Source/core/loader/FrameFetchContext.cpp
+++ b/Source/core/loader/FrameFetchContext.cpp
@@ -222,8 +222,12 @@ void FrameFetchContext::dispatchDidReceiveResponse(unsigned long identifier, con
{
MixedContentChecker::checkMixedPrivatePublic(frame(), response.remoteIPAddress());
LinkLoader::loadLinkFromHeader(response.httpHeaderField("Link"), frame()->document());
- if (m_documentLoader == frame()->loader().provisionalDocumentLoader())
- handleAcceptClientHintsHeader(response.httpHeaderField("accept-ch"), m_documentLoader->clientHintsPreferences());
+ if (m_documentLoader == frame()->loader().provisionalDocumentLoader()) {
+ ResourceFetcher* fetcher = nullptr;
+ if (frame()->document())
+ fetcher = frame()->document()->fetcher();
+ handleAcceptClientHintsHeader(response.httpHeaderField("accept-ch"), m_documentLoader->clientHintsPreferences(), fetcher);
+ }
frame()->loader().progress().incrementProgress(identifier, response);
frame()->loader().client()->dispatchDidReceiveResponse(m_documentLoader, identifier, response);
@@ -637,6 +641,21 @@ void FrameFetchContext::addCSPHeaderIfNecessary(Resource::Type type, FetchReques
fetchRequest.mutableResourceRequest().addHTTPHeaderField("CSP", "active");
}
+void FrameFetchContext::countClientHintsDPR()
+{
+ UseCounter::count(frame(), UseCounter::ClientHintsDPR);
+}
+
+void FrameFetchContext::countClientHintsResourceWidth()
+{
+ UseCounter::count(frame(), UseCounter::ClientHintsResourceWidth);
+}
+
+void FrameFetchContext::countClientHintsViewportWidth()
+{
+ UseCounter::count(frame(), UseCounter::ClientHintsViewportWidth);
+}
+
DEFINE_TRACE(FrameFetchContext)
{
visitor->trace(m_document);
« no previous file with comments | « Source/core/loader/FrameFetchContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698