| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef TokenizedChunkQueue_h | 5 #ifndef TokenizedChunkQueue_h |
| 6 #define TokenizedChunkQueue_h | 6 #define TokenizedChunkQueue_h |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include "core/html/parser/HTMLDocumentParser.h" | 9 #include "core/html/parser/HTMLDocumentParser.h" |
| 9 #include "wtf/Deque.h" | 10 #include "wtf/Deque.h" |
| 10 #include "wtf/PassRefPtr.h" | 11 #include "wtf/PassRefPtr.h" |
| 11 #include "wtf/ThreadSafeRefCounted.h" | 12 #include "wtf/ThreadSafeRefCounted.h" |
| 12 #include "wtf/ThreadingPrimitives.h" | 13 #include "wtf/ThreadingPrimitives.h" |
| 13 #include "wtf/Vector.h" | 14 #include "wtf/Vector.h" |
| 14 #include <memory> | |
| 15 | 15 |
| 16 namespace blink { | 16 namespace blink { |
| 17 | 17 |
| 18 // TokenizedChunkQueue is used to transfer parsed HTML token chunks | 18 // TokenizedChunkQueue is used to transfer parsed HTML token chunks |
| 19 // from BackgroundHTMLParser thread to Blink main thread without | 19 // from BackgroundHTMLParser thread to Blink main thread without |
| 20 // spamming task queue. | 20 // spamming task queue. |
| 21 // TokenizedChunkQueue is accessed from both BackgroundHTMLParser | 21 // TokenizedChunkQueue is accessed from both BackgroundHTMLParser |
| 22 // thread (producer) and Blink main thread (consumer). | 22 // thread (producer) and Blink main thread (consumer). |
| 23 // Access to the backend queue vector is protected by a mutex. | 23 // Access to the backend queue vector is protected by a mutex. |
| 24 // If enqueue is done against empty queue, BackgroundHTMLParser | 24 // If enqueue is done against empty queue, BackgroundHTMLParser |
| (...skipping 18 matching lines...) Expand all Loading... |
| 43 | 43 |
| 44 Vector<std::unique_ptr<HTMLDocumentParser::TokenizedChunk>> m_pendingChunks; | 44 Vector<std::unique_ptr<HTMLDocumentParser::TokenizedChunk>> m_pendingChunks; |
| 45 size_t m_peakPendingChunkCount = 0; | 45 size_t m_peakPendingChunkCount = 0; |
| 46 size_t m_peakPendingTokenCount = 0; | 46 size_t m_peakPendingTokenCount = 0; |
| 47 size_t m_pendingTokenCount = 0; | 47 size_t m_pendingTokenCount = 0; |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 } // namespace blink | 50 } // namespace blink |
| 51 | 51 |
| 52 #endif | 52 #endif |
| OLD | NEW |