OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 } | 340 } |
341 } | 341 } |
342 | 342 |
343 if (m_pendingCSPMetaToken || !document()->documentElement()) { | 343 if (m_pendingCSPMetaToken || !document()->documentElement()) { |
344 PreloadRequestStream linkRelPreloads; | 344 PreloadRequestStream linkRelPreloads; |
345 for (auto& chunk : pendingChunks) { | 345 for (auto& chunk : pendingChunks) { |
346 for (auto& request : chunk->preloads) { | 346 for (auto& request : chunk->preloads) { |
347 // Link rel preloads don't need to wait for AppCache but they | 347 // Link rel preloads don't need to wait for AppCache but they |
348 // should probably wait for CSP. | 348 // should probably wait for CSP. |
349 if (!m_pendingCSPMetaToken && request->isLinkRelPreload()) | 349 if (!m_pendingCSPMetaToken && request->isLinkRelPreload()) |
350 linkRelPreloads.append(std::move(request)); | 350 linkRelPreloads.push_back(std::move(request)); |
351 else | 351 else |
352 m_queuedPreloads.append(std::move(request)); | 352 m_queuedPreloads.push_back(std::move(request)); |
353 } | 353 } |
354 for (auto& index : chunk->likelyDocumentWriteScriptIndices) { | 354 for (auto& index : chunk->likelyDocumentWriteScriptIndices) { |
355 const CompactHTMLToken& token = chunk->tokens->at(index); | 355 const CompactHTMLToken& token = chunk->tokens->at(index); |
356 ASSERT(token.type() == HTMLToken::TokenType::Character); | 356 ASSERT(token.type() == HTMLToken::TokenType::Character); |
357 m_queuedDocumentWriteScripts.append(token.data()); | 357 m_queuedDocumentWriteScripts.push_back(token.data()); |
358 } | 358 } |
359 } | 359 } |
360 m_preloader->takeAndPreload(linkRelPreloads); | 360 m_preloader->takeAndPreload(linkRelPreloads); |
361 } else { | 361 } else { |
362 // We can safely assume that there are no queued preloads request after the | 362 // We can safely assume that there are no queued preloads request after the |
363 // document element is available, as we empty the queue immediately after | 363 // document element is available, as we empty the queue immediately after |
364 // the document element is created in documentElementAvailable(). | 364 // the document element is created in documentElementAvailable(). |
365 ASSERT(m_queuedPreloads.isEmpty()); | 365 ASSERT(m_queuedPreloads.isEmpty()); |
366 ASSERT(m_queuedDocumentWriteScripts.isEmpty()); | 366 ASSERT(m_queuedDocumentWriteScripts.isEmpty()); |
367 // Loop through the chunks to generate preloads before any document.write | 367 // Loop through the chunks to generate preloads before any document.write |
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1310 case Asynchronous: | 1310 case Asynchronous: |
1311 m_loadingTaskRunner->postTask( | 1311 m_loadingTaskRunner->postTask( |
1312 BLINK_FROM_HERE, | 1312 BLINK_FROM_HERE, |
1313 WTF::bind(function, std::forward<Ps>(parameters)...)); | 1313 WTF::bind(function, std::forward<Ps>(parameters)...)); |
1314 return; | 1314 return; |
1315 } | 1315 } |
1316 NOTREACHED(); | 1316 NOTREACHED(); |
1317 } | 1317 } |
1318 | 1318 |
1319 } // namespace blink | 1319 } // namespace blink |
OLD | NEW |