| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2013 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 11 matching lines...) Expand all Loading... |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "core/html/parser/BackgroundHTMLParser.h" | 26 #include "core/html/parser/BackgroundHTMLParser.h" |
| 27 | 27 |
| 28 #include "core/HTMLNames.h" | 28 #include "core/HTMLNames.h" |
| 29 #include "core/html/parser/HTMLDocumentParser.h" | 29 #include "core/html/parser/HTMLDocumentParser.h" |
| 30 #include "core/html/parser/TextResourceDecoder.h" | 30 #include "core/html/parser/TextResourceDecoder.h" |
| 31 #include "core/html/parser/XSSAuditor.h" | 31 #include "core/html/parser/XSSAuditor.h" |
| 32 #include "platform/Task.h" | |
| 33 #include "platform/ThreadSafeFunctional.h" | 32 #include "platform/ThreadSafeFunctional.h" |
| 34 #include "public/platform/Platform.h" | 33 #include "public/platform/Platform.h" |
| 35 #include "public/platform/WebTaskRunner.h" | 34 #include "public/platform/WebTaskRunner.h" |
| 36 #include "wtf/text/TextPosition.h" | 35 #include "wtf/text/TextPosition.h" |
| 37 | 36 |
| 38 namespace blink { | 37 namespace blink { |
| 39 | 38 |
| 40 // On a network with high latency and high bandwidth, using a device | 39 // On a network with high latency and high bandwidth, using a device |
| 41 // with a fast CPU, we could end up speculatively tokenizing | 40 // with a fast CPU, we could end up speculatively tokenizing |
| 42 // the whole document, well ahead of when the main-thread actually needs it. | 41 // the whole document, well ahead of when the main-thread actually needs it. |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 chunk->inputCheckpoint = m_input.createCheckpoint(m_pendingTokens->size()); | 288 chunk->inputCheckpoint = m_input.createCheckpoint(m_pendingTokens->size()); |
| 290 chunk->preloadScannerCheckpoint = m_preloadScanner->createCheckpoint(); | 289 chunk->preloadScannerCheckpoint = m_preloadScanner->createCheckpoint(); |
| 291 chunk->tokens = m_pendingTokens.release(); | 290 chunk->tokens = m_pendingTokens.release(); |
| 292 chunk->startingScript = m_startingScript; | 291 chunk->startingScript = m_startingScript; |
| 293 m_startingScript = false; | 292 m_startingScript = false; |
| 294 | 293 |
| 295 bool isEmpty = m_parsedChunkQueue->enqueue(chunk.release()); | 294 bool isEmpty = m_parsedChunkQueue->enqueue(chunk.release()); |
| 296 if (isEmpty) { | 295 if (isEmpty) { |
| 297 m_loadingTaskRunner->postTask( | 296 m_loadingTaskRunner->postTask( |
| 298 BLINK_FROM_HERE, | 297 BLINK_FROM_HERE, |
| 299 new Task(threadSafeBind(&HTMLDocumentParser::notifyPendingParsedChun
ks, AllowCrossThreadAccess(m_parser)))); | 298 threadSafeBind(&HTMLDocumentParser::notifyPendingParsedChunks, Allow
CrossThreadAccess(m_parser))); |
| 300 } | 299 } |
| 301 | 300 |
| 302 m_pendingTokens = adoptPtr(new CompactHTMLTokenStream); | 301 m_pendingTokens = adoptPtr(new CompactHTMLTokenStream); |
| 303 } | 302 } |
| 304 | 303 |
| 305 } // namespace blink | 304 } // namespace blink |
| OLD | NEW |