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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 198 pictureData.sourceSize = m_sourceSize; | 198 pictureData.sourceSize = m_sourceSize; |
| 199 pictureData.picked = true; | 199 pictureData.picked = true; |
| 200 } else if (match(m_tagImpl, imgTag) && !pictureData.sourceURL.isEmpty()) { | 200 } else if (match(m_tagImpl, imgTag) && !pictureData.sourceURL.isEmpty()) { |
| 201 setUrlToLoad(pictureData.sourceURL, AllowURLReplacement); | 201 setUrlToLoad(pictureData.sourceURL, AllowURLReplacement); |
| 202 } | 202 } |
| 203 } | 203 } |
| 204 | 204 |
| 205 PassOwnPtr<PreloadRequest> createPreloadRequest(const KURL& predictedBaseURL , const SegmentedString& source, const ClientHintsPreferences& clientHintsPrefer ences, const PictureData& pictureData, const ReferrerPolicy documentReferrerPoli cy) | 205 PassOwnPtr<PreloadRequest> createPreloadRequest(const KURL& predictedBaseURL , const SegmentedString& source, const ClientHintsPreferences& clientHintsPrefer ences, const PictureData& pictureData, const ReferrerPolicy documentReferrerPoli cy) |
| 206 { | 206 { |
| 207 PreloadRequest::RequestType requestType = PreloadRequest::RequestTypePre load; | 207 PreloadRequest::RequestType requestType = PreloadRequest::RequestTypePre load; |
| 208 if (shouldPreconnect()) | 208 if (shouldPreconnect()) { |
| 209 requestType = PreloadRequest::RequestTypePreconnect; | 209 requestType = PreloadRequest::RequestTypePreconnect; |
| 210 else if (isLinkRelPreload()) | 210 } else if (!shouldPreload() || !m_matchedMediaAttribute) { |
| 211 return nullptr; | |
| 212 } | |
| 213 | |
| 214 if (isLinkRelPreload()) { | |
|
Nate Chapin
2016/05/17 17:16:55
Which of these cases really should be mutually exc
Yoav Weiss
2016/05/17 21:45:48
Good point. I changed the conditions to represent
| |
| 211 requestType = PreloadRequest::RequestTypeLinkRelPreload; | 215 requestType = PreloadRequest::RequestTypeLinkRelPreload; |
| 212 else if (!shouldPreload() || !m_matchedMediaAttribute) | 216 } |
| 213 return nullptr; | |
| 214 | 217 |
| 215 TextPosition position = TextPosition(source.currentLine(), source.curren tColumn()); | 218 TextPosition position = TextPosition(source.currentLine(), source.curren tColumn()); |
| 216 FetchRequest::ResourceWidth resourceWidth; | 219 FetchRequest::ResourceWidth resourceWidth; |
| 217 float sourceSize = m_sourceSize; | 220 float sourceSize = m_sourceSize; |
| 218 bool sourceSizeSet = m_sourceSizeSet; | 221 bool sourceSizeSet = m_sourceSizeSet; |
| 219 if (pictureData.picked) { | 222 if (pictureData.picked) { |
| 220 sourceSizeSet = pictureData.sourceSizeSet; | 223 sourceSizeSet = pictureData.sourceSizeSet; |
| 221 sourceSize = pictureData.sourceSize; | 224 sourceSize = pictureData.sourceSize; |
| 222 } | 225 } |
| 223 if (sourceSizeSet) { | 226 if (sourceSizeSet) { |
| (...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 798 ASSERT(document); | 801 ASSERT(document); |
| 799 doHtmlPreloadScanning = !document->settings() || document->settings()->doHtm lPreloadScanning(); | 802 doHtmlPreloadScanning = !document->settings() || document->settings()->doHtm lPreloadScanning(); |
| 800 doDocumentWritePreloadScanning = doHtmlPreloadScanning && document->frame() && document->frame()->isMainFrame(); | 803 doDocumentWritePreloadScanning = doHtmlPreloadScanning && document->frame() && document->frame()->isMainFrame(); |
| 801 defaultViewportMinWidth = document->viewportDefaultMinWidth(); | 804 defaultViewportMinWidth = document->viewportDefaultMinWidth(); |
| 802 viewportMetaZeroValuesQuirk = document->settings() && document->settings()-> viewportMetaZeroValuesQuirk(); | 805 viewportMetaZeroValuesQuirk = document->settings() && document->settings()-> viewportMetaZeroValuesQuirk(); |
| 803 viewportMetaEnabled = document->settings() && document->settings()->viewport MetaEnabled(); | 806 viewportMetaEnabled = document->settings() && document->settings()->viewport MetaEnabled(); |
| 804 referrerPolicy = document->getReferrerPolicy(); | 807 referrerPolicy = document->getReferrerPolicy(); |
| 805 } | 808 } |
| 806 | 809 |
| 807 } // namespace blink | 810 } // namespace blink |
| OLD | NEW |