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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 | 241 |
242 // The remaining modifications are only necessary for HTTP and HTTPS. | 242 // The remaining modifications are only necessary for HTTP and HTTPS. |
243 if (!request.url().isEmpty() && !request.url().protocolIsInHTTPFamily()) | 243 if (!request.url().isEmpty() && !request.url().protocolIsInHTTPFamily()) |
244 return; | 244 return; |
245 | 245 |
246 if (frame()->loader().loadType() == FrameLoadTypeReload) | 246 if (frame()->loader().loadType() == FrameLoadTypeReload) |
247 request.clearHTTPHeaderField("Save-Data"); | 247 request.clearHTTPHeaderField("Save-Data"); |
248 | 248 |
249 if (frame()->settings() && frame()->settings()->dataSaverEnabled()) | 249 if (frame()->settings() && frame()->settings()->dataSaverEnabled()) |
250 request.setHTTPHeaderField("Save-Data", "on"); | 250 request.setHTTPHeaderField("Save-Data", "on"); |
251 | |
252 frame()->loader().applyUserAgent(request); | |
253 } | 251 } |
254 | 252 |
255 CachePolicy FrameFetchContext::getCachePolicy() const { | 253 CachePolicy FrameFetchContext::getCachePolicy() const { |
256 if (m_document && m_document->loadEventFinished()) | 254 if (m_document && m_document->loadEventFinished()) |
257 return CachePolicyVerify; | 255 return CachePolicyVerify; |
258 | 256 |
259 FrameLoadType loadType = frame()->loader().loadType(); | 257 FrameLoadType loadType = frame()->loader().loadType(); |
260 if (loadType == FrameLoadTypeReloadBypassingCache) | 258 if (loadType == FrameLoadTypeReloadBypassingCache) |
261 return CachePolicyReload; | 259 return CachePolicyReload; |
262 | 260 |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1013 response); | 1011 response); |
1014 } | 1012 } |
1015 | 1013 |
1016 DEFINE_TRACE(FrameFetchContext) { | 1014 DEFINE_TRACE(FrameFetchContext) { |
1017 visitor->trace(m_document); | 1015 visitor->trace(m_document); |
1018 visitor->trace(m_documentLoader); | 1016 visitor->trace(m_documentLoader); |
1019 FetchContext::trace(visitor); | 1017 FetchContext::trace(visitor); |
1020 } | 1018 } |
1021 | 1019 |
1022 } // namespace blink | 1020 } // namespace blink |
OLD | NEW |