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

Unified Diff: third_party/WebKit/Source/core/fetch/ClientHintsPreferences.cpp

Issue 2584423002: Loading: move core/fetch to platform/loader/fetch (Closed)
Patch Set: another try Created 3 years, 11 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: third_party/WebKit/Source/core/fetch/ClientHintsPreferences.cpp
diff --git a/third_party/WebKit/Source/core/fetch/ClientHintsPreferences.cpp b/third_party/WebKit/Source/core/fetch/ClientHintsPreferences.cpp
deleted file mode 100644
index 5b0c4f4283127afa81d6e71a84934ed173c70bbf..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/core/fetch/ClientHintsPreferences.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "core/fetch/ClientHintsPreferences.h"
-
-#include "platform/RuntimeEnabledFeatures.h"
-#include "platform/network/HTTPParsers.h"
-
-namespace blink {
-
-ClientHintsPreferences::ClientHintsPreferences()
- : m_shouldSendDPR(false),
- m_shouldSendResourceWidth(false),
- m_shouldSendViewportWidth(false) {}
-
-void ClientHintsPreferences::updateFrom(
- const ClientHintsPreferences& preferences) {
- m_shouldSendDPR = preferences.m_shouldSendDPR;
- m_shouldSendResourceWidth = preferences.m_shouldSendResourceWidth;
- m_shouldSendViewportWidth = preferences.m_shouldSendViewportWidth;
-}
-
-void ClientHintsPreferences::updateFromAcceptClientHintsHeader(
- const String& headerValue,
- Context* context) {
- if (!RuntimeEnabledFeatures::clientHintsEnabled() || headerValue.isEmpty())
- return;
-
- CommaDelimitedHeaderSet acceptClientHintsHeader;
- parseCommaDelimitedHeader(headerValue, acceptClientHintsHeader);
- if (acceptClientHintsHeader.contains("dpr")) {
- if (context)
- context->countClientHintsDPR();
- m_shouldSendDPR = true;
- }
-
- if (acceptClientHintsHeader.contains("width")) {
- if (context)
- context->countClientHintsResourceWidth();
- m_shouldSendResourceWidth = true;
- }
-
- if (acceptClientHintsHeader.contains("viewport-width")) {
- if (context)
- context->countClientHintsViewportWidth();
- m_shouldSendViewportWidth = true;
- }
-}
-
-} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698