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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 else if (match(m_tagImpl, imgTag) && !sourceURL.isEmpty()) | 161 else if (match(m_tagImpl, imgTag) && !sourceURL.isEmpty()) |
162 setUrlToLoad(sourceURL, AllowURLReplacement); | 162 setUrlToLoad(sourceURL, AllowURLReplacement); |
163 } | 163 } |
164 | 164 |
165 PassOwnPtr<PreloadRequest> createPreloadRequest(const KURL& predictedBaseURL
, const SegmentedString& source) | 165 PassOwnPtr<PreloadRequest> createPreloadRequest(const KURL& predictedBaseURL
, const SegmentedString& source) |
166 { | 166 { |
167 if (!shouldPreload() || !m_matchedMediaAttribute) | 167 if (!shouldPreload() || !m_matchedMediaAttribute) |
168 return nullptr; | 168 return nullptr; |
169 | 169 |
170 TextPosition position = TextPosition(source.currentLine(), source.curren
tColumn()); | 170 TextPosition position = TextPosition(source.currentLine(), source.curren
tColumn()); |
171 OwnPtr<PreloadRequest> request = PreloadRequest::create(initiatorFor(m_t
agImpl), position, m_urlToLoad, predictedBaseURL, resourceType()); | 171 FetchRequest::ResourceWidth resourceWidth; |
| 172 if (m_sourceSizeSet) { |
| 173 resourceWidth.width = m_sourceSize; |
| 174 resourceWidth.isSet = true; |
| 175 } |
| 176 OwnPtr<PreloadRequest> request = PreloadRequest::create(initiatorFor(m_t
agImpl), position, m_urlToLoad, predictedBaseURL, resourceType(), resourceWidth)
; |
172 if (isCORSEnabled()) | 177 if (isCORSEnabled()) |
173 request->setCrossOriginEnabled(allowStoredCredentials()); | 178 request->setCrossOriginEnabled(allowStoredCredentials()); |
174 request->setCharset(charset()); | 179 request->setCharset(charset()); |
175 request->setDefer(m_defer); | 180 request->setDefer(m_defer); |
176 return request.release(); | 181 return request.release(); |
177 } | 182 } |
178 | 183 |
179 private: | 184 private: |
180 template<typename NameType> | 185 template<typename NameType> |
181 void processScriptAttribute(const NameType& attributeName, const String& att
ributeValue) | 186 void processScriptAttribute(const NameType& attributeName, const String& att
ributeValue) |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 if (m_token.type() == HTMLToken::StartTag) | 557 if (m_token.type() == HTMLToken::StartTag) |
553 m_tokenizer->updateStateFor(attemptStaticStringCreation(m_token.name
(), Likely8Bit)); | 558 m_tokenizer->updateStateFor(attemptStaticStringCreation(m_token.name
(), Likely8Bit)); |
554 m_scanner.scan(m_token, m_source, requests); | 559 m_scanner.scan(m_token, m_source, requests); |
555 m_token.clear(); | 560 m_token.clear(); |
556 } | 561 } |
557 | 562 |
558 preloader->takeAndPreload(requests); | 563 preloader->takeAndPreload(requests); |
559 } | 564 } |
560 | 565 |
561 } | 566 } |
OLD | NEW |