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

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

Issue 2544933003: Split methods for ClientHintsPreferences from FrameFetchContext (Closed)
Patch Set: Rebase 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 54838d534a03af615adc944e7fb6c12f5d7cc371..baf159b83b4283163c2c6c9b047653f2fb008503 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"
@@ -952,18 +954,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.
@@ -996,12 +986,10 @@ void FrameFetchContext::dispatchDidReceiveResponseInternal(
if (m_documentLoader &&
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;
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameFetchContext.h ('k') | third_party/WebKit/Source/core/loader/HttpEquiv.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698