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

Side by Side Diff: Source/core/fetch/ClientHintsPreferences.h

Issue 1183233002: Split RW hint into Width and Viewport-Width (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed and added layout tests 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ClientHintsPreferences_h 5 #ifndef ClientHintsPreferences_h
6 #define ClientHintsPreferences_h 6 #define ClientHintsPreferences_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "wtf/text/WTFString.h" 9 #include "wtf/text/WTFString.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 class DocumentLoader; 13 class Document;
14 14
15 class ClientHintsPreferences { 15 class ClientHintsPreferences {
16 public: 16 public:
17 ClientHintsPreferences() 17 ClientHintsPreferences()
18 : m_shouldSendDPR(false) 18 : m_shouldSendDPR(false)
19 , m_shouldSendRW(false) 19 , m_shouldSendResourceWidth(false)
20 , m_shouldSendViewportWidth(false)
20 { 21 {
21 } 22 }
22 23
23 void set(const ClientHintsPreferences& other) 24 void set(const ClientHintsPreferences& other)
24 { 25 {
25 m_shouldSendDPR = other.m_shouldSendDPR; 26 m_shouldSendDPR = other.m_shouldSendDPR;
26 m_shouldSendRW = other.m_shouldSendRW; 27 m_shouldSendResourceWidth = other.m_shouldSendResourceWidth;
28 m_shouldSendViewportWidth = other.m_shouldSendViewportWidth;
27 } 29 }
28 30
29 void setShouldSendDPR(bool should) { m_shouldSendDPR = should; } 31 void setShouldSendDPR(bool should) { m_shouldSendDPR = should; }
30 void setShouldSendRW(bool should) { m_shouldSendRW = should; } 32 void setShouldSendResourceWidth(bool should) { m_shouldSendResourceWidth = s hould; }
33 void setShouldSendViewportWidth(bool should) { m_shouldSendViewportWidth = s hould; }
31 bool shouldSendDPR() const { return m_shouldSendDPR; } 34 bool shouldSendDPR() const { return m_shouldSendDPR; }
32 bool shouldSendRW() const { return m_shouldSendRW; } 35 bool shouldSendResourceWidth() const { return m_shouldSendResourceWidth; }
36 bool shouldSendViewportWidth() const { return m_shouldSendViewportWidth; }
37
33 private: 38 private:
34 bool m_shouldSendDPR; 39 bool m_shouldSendDPR;
35 bool m_shouldSendRW; 40 bool m_shouldSendResourceWidth;
41 bool m_shouldSendViewportWidth;
36 }; 42 };
37 43
38 CORE_EXPORT void handleAcceptClientHintsHeader(const String& headerValue, Client HintsPreferences&); 44 CORE_EXPORT void handleAcceptClientHintsHeader(const String& headerValue, Client HintsPreferences&);
39 } // namespace blink 45 } // namespace blink
40 #endif 46 #endif
41 47
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/misc/resources/image-checks-for-width.php ('k') | Source/core/fetch/ClientHintsPreferences.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698