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

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

Issue 2544933003: Split methods for ClientHintsPreferences from FrameFetchContext (Closed)
Patch Set: a Created 4 years 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/loader/FrameFetchContext.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
index 049c2e27133a05c7fed4fc1962116c16e9474ea6..86bbd7e40482a1ece33b3329c157499c1d56e73c 100644
--- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
@@ -41,6 +41,7 @@
#include "core/frame/LocalDOMWindow.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/Settings.h"
+#include "core/frame/UseCounter.h"
#include "core/html/HTMLFrameOwnerElement.h"
#include "core/html/imports/HTMLImportsController.h"
#include "core/inspector/ConsoleMessage.h"
@@ -49,6 +50,7 @@
#include "core/inspector/InspectorNetworkAgent.h"
#include "core/inspector/InspectorTraceEvents.h"
#include "core/loader/DocumentLoader.h"
+#include "core/loader/FrameClientHintsPreferencesContext.h"
#include "core/loader/FrameLoader.h"
#include "core/loader/FrameLoaderClient.h"
#include "core/loader/MixedContentChecker.h"
@@ -933,18 +935,6 @@ MHTMLArchive* FrameFetchContext::archive() const {
->archive();
}
-void FrameFetchContext::countClientHintsDPR() {
- UseCounter::count(frame(), UseCounter::ClientHintsDPR);
-}
-
-void FrameFetchContext::countClientHintsResourceWidth() {
- UseCounter::count(frame(), UseCounter::ClientHintsResourceWidth);
-}
-
-void FrameFetchContext::countClientHintsViewportWidth() {
- UseCounter::count(frame(), UseCounter::ClientHintsViewportWidth);
-}
-
ResourceLoadPriority FrameFetchContext::modifyPriorityForExperiments(
ResourceLoadPriority priority) {
// If Settings is null, we can't verify any experiments are in force.
@@ -976,12 +966,10 @@ void FrameFetchContext::dispatchDidReceiveResponseInternal(
response.remoteIPAddress());
if (m_documentLoader &&
m_documentLoader == frame()->loader().provisionalDocumentLoader()) {
- ResourceFetcher* fetcher = nullptr;
- if (frame()->document())
- fetcher = frame()->document()->fetcher();
+ FrameClientHintsPreferencesContext hintsContext(frame());
m_documentLoader->clientHintsPreferences()
.updateFromAcceptClientHintsHeader(
- response.httpHeaderField(HTTPNames::Accept_CH), fetcher);
+ response.httpHeaderField(HTTPNames::Accept_CH), &hintsContext);
// When response is received with a provisional docloader, the resource
// haven't committed yet, and we cannot load resources, only preconnect.
resourceLoadingPolicy = LinkLoader::DoNotLoadResources;

Powered by Google App Engine
This is Rietveld 408576698