| OLD | NEW |
| 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 #include "core/html/parser/PreloadRequest.h" | 5 #include "core/html/parser/PreloadRequest.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/loader/DocumentLoader.h" | 8 #include "core/loader/DocumentLoader.h" |
| 9 #include "platform/CrossOriginAttributeValue.h" | 9 #include "platform/CrossOriginAttributeValue.h" |
| 10 #include "platform/loader/fetch/FetchInitiatorInfo.h" | 10 #include "platform/loader/fetch/FetchInitiatorInfo.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 if (m_requestType == RequestTypeLinkRelPreload) | 68 if (m_requestType == RequestTypeLinkRelPreload) |
| 69 request.setLinkPreload(true); | 69 request.setLinkPreload(true); |
| 70 | 70 |
| 71 if (m_resourceType == Resource::Script || | 71 if (m_resourceType == Resource::Script || |
| 72 m_resourceType == Resource::CSSStyleSheet || | 72 m_resourceType == Resource::CSSStyleSheet || |
| 73 m_resourceType == Resource::ImportResource) { | 73 m_resourceType == Resource::ImportResource) { |
| 74 request.setCharset( | 74 request.setCharset( |
| 75 m_charset.isEmpty() ? document->characterSet().getString() : m_charset); | 75 m_charset.isEmpty() ? document->characterSet().getString() : m_charset); |
| 76 } | 76 } |
| 77 request.setForPreload(true, m_discoveryTime); | 77 request.setSpeculativePreload(true, m_discoveryTime); |
| 78 | 78 |
| 79 return document->loader()->startPreload(m_resourceType, request); | 79 return document->loader()->startPreload(m_resourceType, request); |
| 80 } | 80 } |
| 81 | 81 |
| 82 } // namespace blink | 82 } // namespace blink |
| OLD | NEW |