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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 return true; | 345 return true; |
346 } | 346 } |
347 | 347 |
348 void HTMLDocumentParser::didReceiveParsedChunkFromBackgroundParser(PassOwnPtr<Pa
rsedChunk> chunk) | 348 void HTMLDocumentParser::didReceiveParsedChunkFromBackgroundParser(PassOwnPtr<Pa
rsedChunk> chunk) |
349 { | 349 { |
350 TRACE_EVENT0("blink", "HTMLDocumentParser::didReceiveParsedChunkFromBackgrou
ndParser"); | 350 TRACE_EVENT0("blink", "HTMLDocumentParser::didReceiveParsedChunkFromBackgrou
ndParser"); |
351 | 351 |
352 if (!isParsing()) | 352 if (!isParsing()) |
353 return; | 353 return; |
354 | 354 |
| 355 if (!chunk->preloadedReferrerPolicy.isEmpty()) |
| 356 document()->processReferrerPolicy(chunk->preloadedReferrerPolicy); |
| 357 |
355 // ApplicationCache needs to be initialized before issuing preloads. | 358 // ApplicationCache needs to be initialized before issuing preloads. |
356 // We suspend preload until HTMLHTMLElement is inserted and | 359 // We suspend preload until HTMLHTMLElement is inserted and |
357 // ApplicationCache is initialized. | 360 // ApplicationCache is initialized. |
358 if (!document()->documentElement()) { | 361 if (!document()->documentElement()) { |
359 for (auto& request : chunk->preloads) | 362 for (auto& request : chunk->preloads) |
360 m_queuedPreloads.append(request.release()); | 363 m_queuedPreloads.append(request.release()); |
361 } else { | 364 } else { |
362 // We can safely assume that there are no queued preloads request after | 365 // We can safely assume that there are no queued preloads request after |
363 // the document element is available, as we empty the queue immediately | 366 // the document element is available, as we empty the queue immediately |
364 // after the document element is created in pumpPendingSpeculations(). | 367 // after the document element is created in pumpPendingSpeculations(). |
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1114 void HTMLDocumentParser::setDecoder(PassOwnPtr<TextResourceDecoder> decoder) | 1117 void HTMLDocumentParser::setDecoder(PassOwnPtr<TextResourceDecoder> decoder) |
1115 { | 1118 { |
1116 ASSERT(decoder); | 1119 ASSERT(decoder); |
1117 DecodedDataDocumentParser::setDecoder(decoder); | 1120 DecodedDataDocumentParser::setDecoder(decoder); |
1118 | 1121 |
1119 if (m_haveBackgroundParser) | 1122 if (m_haveBackgroundParser) |
1120 HTMLParserThread::shared()->postTask(threadSafeBind(&BackgroundHTMLParse
r::setDecoder, AllowCrossThreadAccess(m_backgroundParser), takeDecoder())); | 1123 HTMLParserThread::shared()->postTask(threadSafeBind(&BackgroundHTMLParse
r::setDecoder, AllowCrossThreadAccess(m_backgroundParser), takeDecoder())); |
1121 } | 1124 } |
1122 | 1125 |
1123 } | 1126 } |
OLD | NEW |