| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 PassOwnPtr<PreloadRequest> createPreloadRequest(const KURL& predictedBaseURL
, const SegmentedString& source, const ClientHintsPreferences& clientHintsPrefer
ences) | 175 PassOwnPtr<PreloadRequest> createPreloadRequest(const KURL& predictedBaseURL
, const SegmentedString& source, const ClientHintsPreferences& clientHintsPrefer
ences) |
| 176 { | 176 { |
| 177 PreloadRequest::RequestType requestType = PreloadRequest::RequestTypePre
load; | 177 PreloadRequest::RequestType requestType = PreloadRequest::RequestTypePre
load; |
| 178 if (shouldPreconnect()) | 178 if (shouldPreconnect()) |
| 179 requestType = PreloadRequest::RequestTypePreconnect; | 179 requestType = PreloadRequest::RequestTypePreconnect; |
| 180 else if (!shouldPreload() || !m_matchedMediaAttribute) | 180 else if (!shouldPreload() || !m_matchedMediaAttribute) |
| 181 return nullptr; | 181 return nullptr; |
| 182 | 182 |
| 183 TextPosition position = TextPosition(source.currentLine(), source.curren
tColumn()); | 183 TextPosition position = TextPosition(source.currentLine(), source.curren
tColumn()); |
| 184 FetchRequest::ResourceWidth resourceWidth; | 184 FetchRequest::ResourceWidth resourceWidth; |
| 185 if (m_sourceSizeSet && m_srcsetImageCandidate.resourceWidth() != Uniniti
alizedDescriptor) { | 185 if (m_sourceSizeSet) { |
| 186 resourceWidth.width = m_sourceSize; | 186 resourceWidth.width = m_sourceSize; |
| 187 resourceWidth.isSet = true; | 187 resourceWidth.isSet = true; |
| 188 } else { | 188 } else { |
| 189 resourceWidth.isSet = m_widthValueSet; | 189 resourceWidth.isSet = m_widthValueSet; |
| 190 resourceWidth.width = m_widthValue; | 190 resourceWidth.width = m_widthValue; |
| 191 } | 191 } |
| 192 | 192 |
| 193 OwnPtr<PreloadRequest> request = PreloadRequest::create(initiatorFor(m_t
agImpl), position, m_urlToLoad, predictedBaseURL, resourceType(), resourceWidth,
clientHintsPreferences, requestType); | 193 OwnPtr<PreloadRequest> request = PreloadRequest::create(initiatorFor(m_t
agImpl), position, m_urlToLoad, predictedBaseURL, resourceType(), resourceWidth,
clientHintsPreferences, requestType); |
| 194 if (isCORSEnabled()) | 194 if (isCORSEnabled()) |
| 195 request->setCrossOriginEnabled(allowStoredCredentials()); | 195 request->setCrossOriginEnabled(allowStoredCredentials()); |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 mediaValues = givenMediaValues; | 631 mediaValues = givenMediaValues; |
| 632 else | 632 else |
| 633 mediaValues = MediaValuesCached::create(*document); | 633 mediaValues = MediaValuesCached::create(*document); |
| 634 ASSERT(mediaValues->isSafeToSendToAnotherThread()); | 634 ASSERT(mediaValues->isSafeToSendToAnotherThread()); |
| 635 defaultViewportMinWidth = document->viewportDefaultMinWidth(); | 635 defaultViewportMinWidth = document->viewportDefaultMinWidth(); |
| 636 viewportMetaZeroValuesQuirk = document->settings() && document->settings()->
viewportMetaZeroValuesQuirk(); | 636 viewportMetaZeroValuesQuirk = document->settings() && document->settings()->
viewportMetaZeroValuesQuirk(); |
| 637 viewportMetaEnabled = document->settings() && document->settings()->viewport
MetaEnabled(); | 637 viewportMetaEnabled = document->settings() && document->settings()->viewport
MetaEnabled(); |
| 638 } | 638 } |
| 639 | 639 |
| 640 } | 640 } |
| OLD | NEW |