OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 | 368 |
369 if (m_document) { | 369 if (m_document) { |
370 request.setExternalRequestStateFromRequestorAddressSpace( | 370 request.setExternalRequestStateFromRequestorAddressSpace( |
371 m_document->addressSpace()); | 371 m_document->addressSpace()); |
372 } | 372 } |
373 | 373 |
374 // The remaining modifications are only necessary for HTTP and HTTPS. | 374 // The remaining modifications are only necessary for HTTP and HTTPS. |
375 if (!request.url().isEmpty() && !request.url().protocolIsInHTTPFamily()) | 375 if (!request.url().isEmpty() && !request.url().protocolIsInHTTPFamily()) |
376 return; | 376 return; |
377 | 377 |
378 if (masterDocumentLoader()->loadType() == FrameLoadTypeReload) | 378 // Reload should reflect the current data saver setting. |
| 379 if (isReloadLoadType(masterDocumentLoader()->loadType())) |
379 request.clearHTTPHeaderField("Save-Data"); | 380 request.clearHTTPHeaderField("Save-Data"); |
380 | 381 |
381 if (frame()->settings() && frame()->settings()->getDataSaverEnabled()) | 382 if (frame()->settings() && frame()->settings()->getDataSaverEnabled()) |
382 request.setHTTPHeaderField("Save-Data", "on"); | 383 request.setHTTPHeaderField("Save-Data", "on"); |
383 } | 384 } |
384 | 385 |
385 WebCachePolicy FrameFetchContext::resourceRequestCachePolicy( | 386 WebCachePolicy FrameFetchContext::resourceRequestCachePolicy( |
386 ResourceRequest& request, | 387 ResourceRequest& request, |
387 Resource::Type type, | 388 Resource::Type type, |
388 FetchRequest::DeferOption defer) const { | 389 FetchRequest::DeferOption defer) const { |
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1080 response); | 1081 response); |
1081 } | 1082 } |
1082 | 1083 |
1083 DEFINE_TRACE(FrameFetchContext) { | 1084 DEFINE_TRACE(FrameFetchContext) { |
1084 visitor->trace(m_document); | 1085 visitor->trace(m_document); |
1085 visitor->trace(m_documentLoader); | 1086 visitor->trace(m_documentLoader); |
1086 FetchContext::trace(visitor); | 1087 FetchContext::trace(visitor); |
1087 } | 1088 } |
1088 | 1089 |
1089 } // namespace blink | 1090 } // namespace blink |
OLD | NEW |