| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/ | 3 * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/ |
| 4 * Copyright (C) 2010 Google Inc. All Rights Reserved. | 4 * Copyright (C) 2010 Google Inc. All Rights Reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 if (!resourceType(type)) | 229 if (!resourceType(type)) |
| 230 return nullptr; | 230 return nullptr; |
| 231 | 231 |
| 232 // The element's 'referrerpolicy' attribute (if present) takes precedenc
e over the document's referrer policy. | 232 // The element's 'referrerpolicy' attribute (if present) takes precedenc
e over the document's referrer policy. |
| 233 ReferrerPolicy referrerPolicy = (m_referrerPolicy != ReferrerPolicyDefau
lt) ? m_referrerPolicy : documentReferrerPolicy; | 233 ReferrerPolicy referrerPolicy = (m_referrerPolicy != ReferrerPolicyDefau
lt) ? m_referrerPolicy : documentReferrerPolicy; |
| 234 OwnPtr<PreloadRequest> request = PreloadRequest::create(initiatorFor(m_t
agImpl), position, m_urlToLoad, predictedBaseURL, type, referrerPolicy, resource
Width, clientHintsPreferences, requestType); | 234 OwnPtr<PreloadRequest> request = PreloadRequest::create(initiatorFor(m_t
agImpl), position, m_urlToLoad, predictedBaseURL, type, referrerPolicy, resource
Width, clientHintsPreferences, requestType); |
| 235 request->setCrossOrigin(m_crossOrigin); | 235 request->setCrossOrigin(m_crossOrigin); |
| 236 request->setCharset(charset()); | 236 request->setCharset(charset()); |
| 237 request->setDefer(m_defer); | 237 request->setDefer(m_defer); |
| 238 request->setIntegrityMetadata(m_integrityMetadata); | 238 request->setIntegrityMetadata(m_integrityMetadata); |
| 239 return request.release(); | 239 return request; |
| 240 } | 240 } |
| 241 | 241 |
| 242 private: | 242 private: |
| 243 template<typename NameType> | 243 template<typename NameType> |
| 244 void processScriptAttribute(const NameType& attributeName, const String& att
ributeValue) | 244 void processScriptAttribute(const NameType& attributeName, const String& att
ributeValue) |
| 245 { | 245 { |
| 246 // FIXME - Don't set crossorigin multiple times. | 246 // FIXME - Don't set crossorigin multiple times. |
| 247 if (match(attributeName, srcAttr)) | 247 if (match(attributeName, srcAttr)) |
| 248 setUrlToLoad(attributeValue, DisallowURLReplacement); | 248 setUrlToLoad(attributeValue, DisallowURLReplacement); |
| 249 else if (match(attributeName, crossoriginAttr)) | 249 else if (match(attributeName, crossoriginAttr)) |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 m_pictureData = PictureData(); | 729 m_pictureData = PictureData(); |
| 730 return; | 730 return; |
| 731 } | 731 } |
| 732 | 732 |
| 733 StartTagScanner scanner(tagImpl, m_mediaValues); | 733 StartTagScanner scanner(tagImpl, m_mediaValues); |
| 734 scanner.processAttributes(token.attributes()); | 734 scanner.processAttributes(token.attributes()); |
| 735 if (m_inPicture) | 735 if (m_inPicture) |
| 736 scanner.handlePictureSourceURL(m_pictureData); | 736 scanner.handlePictureSourceURL(m_pictureData); |
| 737 OwnPtr<PreloadRequest> request = scanner.createPreloadRequest(m_predicte
dBaseElementURL, source, m_clientHintsPreferences, m_pictureData, m_documentPara
meters->referrerPolicy); | 737 OwnPtr<PreloadRequest> request = scanner.createPreloadRequest(m_predicte
dBaseElementURL, source, m_clientHintsPreferences, m_pictureData, m_documentPara
meters->referrerPolicy); |
| 738 if (request) | 738 if (request) |
| 739 requests.append(request.release()); | 739 requests.append(std::move(request)); |
| 740 return; | 740 return; |
| 741 } | 741 } |
| 742 default: { | 742 default: { |
| 743 return; | 743 return; |
| 744 } | 744 } |
| 745 } | 745 } |
| 746 } | 746 } |
| 747 | 747 |
| 748 template<typename Token> | 748 template<typename Token> |
| 749 void TokenPreloadScanner::updatePredictedBaseURL(const Token& token) | 749 void TokenPreloadScanner::updatePredictedBaseURL(const Token& token) |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 ASSERT(document); | 798 ASSERT(document); |
| 799 doHtmlPreloadScanning = !document->settings() || document->settings()->doHtm
lPreloadScanning(); | 799 doHtmlPreloadScanning = !document->settings() || document->settings()->doHtm
lPreloadScanning(); |
| 800 doDocumentWritePreloadScanning = doHtmlPreloadScanning && document->frame()
&& document->frame()->isMainFrame(); | 800 doDocumentWritePreloadScanning = doHtmlPreloadScanning && document->frame()
&& document->frame()->isMainFrame(); |
| 801 defaultViewportMinWidth = document->viewportDefaultMinWidth(); | 801 defaultViewportMinWidth = document->viewportDefaultMinWidth(); |
| 802 viewportMetaZeroValuesQuirk = document->settings() && document->settings()->
viewportMetaZeroValuesQuirk(); | 802 viewportMetaZeroValuesQuirk = document->settings() && document->settings()->
viewportMetaZeroValuesQuirk(); |
| 803 viewportMetaEnabled = document->settings() && document->settings()->viewport
MetaEnabled(); | 803 viewportMetaEnabled = document->settings() && document->settings()->viewport
MetaEnabled(); |
| 804 referrerPolicy = document->getReferrerPolicy(); | 804 referrerPolicy = document->getReferrerPolicy(); |
| 805 } | 805 } |
| 806 | 806 |
| 807 } // namespace blink | 807 } // namespace blink |
| OLD | NEW |