Chromium Code Reviews| Index: third_party/WebKit/Source/platform/loader/fetch/ClientHintsPreferences.cpp |
| diff --git a/third_party/WebKit/Source/platform/loader/fetch/ClientHintsPreferences.cpp b/third_party/WebKit/Source/platform/loader/fetch/ClientHintsPreferences.cpp |
| index 4e0a5ed88605a7a6a6852086ae5a05609ea11376..4285a07ec6255992661f9b9fa62e87d631f63d4d 100644 |
| --- a/third_party/WebKit/Source/platform/loader/fetch/ClientHintsPreferences.cpp |
| +++ b/third_party/WebKit/Source/platform/loader/fetch/ClientHintsPreferences.cpp |
| @@ -10,12 +10,14 @@ |
| namespace blink { |
| ClientHintsPreferences::ClientHintsPreferences() |
| - : should_send_dpr_(false), |
| + : should_send_device_ram_(false), |
| + should_send_dpr_(false), |
| should_send_resource_width_(false), |
| should_send_viewport_width_(false) {} |
| void ClientHintsPreferences::UpdateFrom( |
| const ClientHintsPreferences& preferences) { |
| + should_send_device_ram_ = preferences.should_send_device_ram_; |
| should_send_dpr_ = preferences.should_send_dpr_; |
| should_send_resource_width_ = preferences.should_send_resource_width_; |
| should_send_viewport_width_ = preferences.should_send_viewport_width_; |
| @@ -29,6 +31,14 @@ void ClientHintsPreferences::UpdateFromAcceptClientHintsHeader( |
| CommaDelimitedHeaderSet accept_client_hints_header; |
| ParseCommaDelimitedHeader(header_value, accept_client_hints_header); |
| + if (RuntimeEnabledFeatures::deviceRAMHeaderEnabled()) { |
| + if (accept_client_hints_header.Contains("device-ram")) { |
|
Yoav Weiss
2017/05/26 20:48:15
Can you `&&` these two conditions?
fmeawad
2017/05/30 17:20:59
Done.
|
| + if (context) |
| + context->CountClientHintsDeviceRAM(); |
| + should_send_device_ram_ = true; |
| + } |
| + } |
| + |
| if (accept_client_hints_header.Contains("dpr")) { |
| if (context) |
| context->CountClientHintsDPR(); |