Chromium Code Reviews| 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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 237 return nullptr; | 237 return nullptr; |
| 238 | 238 |
| 239 // The element's 'referrerpolicy' attribute (if present) takes precedence | 239 // The element's 'referrerpolicy' attribute (if present) takes precedence |
| 240 // over the document's referrer policy. | 240 // over the document's referrer policy. |
| 241 ReferrerPolicy referrerPolicy = (m_referrerPolicy != ReferrerPolicyDefault) | 241 ReferrerPolicy referrerPolicy = (m_referrerPolicy != ReferrerPolicyDefault) |
| 242 ? m_referrerPolicy | 242 ? m_referrerPolicy |
| 243 : documentReferrerPolicy; | 243 : documentReferrerPolicy; |
| 244 std::unique_ptr<PreloadRequest> request = PreloadRequest::create( | 244 std::unique_ptr<PreloadRequest> request = PreloadRequest::create( |
| 245 initiatorFor(m_tagImpl), position, m_urlToLoad, predictedBaseURL, type, | 245 initiatorFor(m_tagImpl), position, m_urlToLoad, predictedBaseURL, type, |
| 246 referrerPolicy, resourceWidth, clientHintsPreferences, requestType); | 246 referrerPolicy, resourceWidth, clientHintsPreferences, requestType); |
| 247 if (!request) | |
| 248 return nullptr; | |
| 249 | |
| 247 request->setCrossOrigin(m_crossOrigin); | 250 request->setCrossOrigin(m_crossOrigin); |
| 248 request->setNonce(m_nonce); | 251 request->setNonce(m_nonce); |
| 249 request->setCharset(charset()); | 252 request->setCharset(charset()); |
| 250 request->setDefer(m_defer); | 253 request->setDefer(m_defer); |
| 251 request->setIntegrityMetadata(m_integrityMetadata); | 254 request->setIntegrityMetadata(m_integrityMetadata); |
| 252 | 255 |
| 253 // TODO(csharrison): Once this is deprecated, just abort the request here. | 256 // TODO(csharrison): Once this is deprecated, just abort the request here. |
| 254 if (match(m_tagImpl, scriptTag) && | 257 if (match(m_tagImpl, scriptTag) && |
| 255 !ScriptLoader::isValidScriptTypeAndLanguage( | 258 !ScriptLoader::isValidScriptTypeAndLanguage( |
| 256 m_typeAttributeValue, m_languageAttributeValue, | 259 m_typeAttributeValue, m_languageAttributeValue, |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 474 bool shouldPreload() const { | 477 bool shouldPreload() const { |
| 475 if (m_urlToLoad.isEmpty()) | 478 if (m_urlToLoad.isEmpty()) |
| 476 return false; | 479 return false; |
| 477 if (!m_matched) | 480 if (!m_matched) |
| 478 return false; | 481 return false; |
| 479 if (match(m_tagImpl, linkTag) && !m_linkIsStyleSheet && !m_linkIsImport && | 482 if (match(m_tagImpl, linkTag) && !m_linkIsStyleSheet && !m_linkIsImport && |
| 480 !m_linkIsPreload) | 483 !m_linkIsPreload) |
| 481 return false; | 484 return false; |
| 482 if (match(m_tagImpl, inputTag) && !m_inputIsImage) | 485 if (match(m_tagImpl, inputTag) && !m_inputIsImage) |
| 483 return false; | 486 return false; |
| 487 | |
|
Charlie Harrison
2016/10/21 21:38:55
will remove
| |
| 484 return true; | 488 return true; |
| 485 } | 489 } |
| 486 | 490 |
| 487 void setCrossOrigin(const String& corsSetting) { | 491 void setCrossOrigin(const String& corsSetting) { |
| 488 m_crossOrigin = crossOriginAttributeValue(corsSetting); | 492 m_crossOrigin = crossOriginAttributeValue(corsSetting); |
| 489 } | 493 } |
| 490 | 494 |
| 491 void setNonce(const String& nonce) { m_nonce = nonce; } | 495 void setNonce(const String& nonce) { m_nonce = nonce; } |
| 492 | 496 |
| 493 void setDefer(FetchRequest::DeferOption defer) { m_defer = defer; } | 497 void setDefer(FetchRequest::DeferOption defer) { m_defer = defer; } |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 892 defaultViewportMinWidth = document->viewportDefaultMinWidth(); | 896 defaultViewportMinWidth = document->viewportDefaultMinWidth(); |
| 893 viewportMetaZeroValuesQuirk = | 897 viewportMetaZeroValuesQuirk = |
| 894 document->settings() && | 898 document->settings() && |
| 895 document->settings()->viewportMetaZeroValuesQuirk(); | 899 document->settings()->viewportMetaZeroValuesQuirk(); |
| 896 viewportMetaEnabled = | 900 viewportMetaEnabled = |
| 897 document->settings() && document->settings()->viewportMetaEnabled(); | 901 document->settings() && document->settings()->viewportMetaEnabled(); |
| 898 referrerPolicy = document->getReferrerPolicy(); | 902 referrerPolicy = document->getReferrerPolicy(); |
| 899 } | 903 } |
| 900 | 904 |
| 901 } // namespace blink | 905 } // namespace blink |
| OLD | NEW |