Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Side by Side Diff: third_party/WebKit/Source/core/html/parser/ParsedChunkQueue.cpp

Issue 1422233002: Revert of BackgroundHTMLParser: Introduce ParsedChunkQueue to pass ParsedChunks to main thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/html/parser/ParsedChunkQueue.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/parser/ParsedChunkQueue.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698