| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "config.h" | |
| 6 #include "core/html/parser/ParsedChunkQueue.h" | |
| 7 | |
| 8 namespace blink { | |
| 9 | |
| 10 ParsedChunkQueue::ParsedChunkQueue() | |
| 11 { | |
| 12 } | |
| 13 | |
| 14 bool ParsedChunkQueue::enqueue(PassOwnPtr<HTMLDocumentParser::ParsedChunk> chunk
) | |
| 15 { | |
| 16 MutexLocker locker(m_mutex); | |
| 17 | |
| 18 bool wasEmpty = m_pendingChunks.isEmpty(); | |
| 19 m_pendingChunks.append(chunk); | |
| 20 return wasEmpty; | |
| 21 } | |
| 22 | |
| 23 void ParsedChunkQueue::clear() | |
| 24 { | |
| 25 MutexLocker locker(m_mutex); | |
| 26 | |
| 27 m_pendingChunks.clear(); | |
| 28 } | |
| 29 | |
| 30 void ParsedChunkQueue::takeAll(Vector<OwnPtr<HTMLDocumentParser::ParsedChunk>>&
vector) | |
| 31 { | |
| 32 MutexLocker locker(m_mutex); | |
| 33 | |
| 34 ASSERT(vector.isEmpty()); | |
| 35 m_pendingChunks.swap(vector); | |
| 36 } | |
| 37 | |
| 38 } // namespace blink | |
| OLD | NEW |