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

Side by Side Diff: Source/core/loader/DocumentWriter.cpp

Issue 100563004: Redirect HTML resource bytes directly to parser thread (Blink side CL) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@parserthread_decodermove
Patch Set: Missing include Created 7 years 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010. Adam Barth. All rights reserved. 2 * Copyright (C) 2010. Adam Barth. 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 ASSERT(m_parser); 86 ASSERT(m_parser);
87 if (m_parser->needsDecoder() && 0 < length) { 87 if (m_parser->needsDecoder() && 0 < length) {
88 OwnPtr<TextResourceDecoder> decoder = m_decoderBuilder.buildFor(m_docume nt); 88 OwnPtr<TextResourceDecoder> decoder = m_decoderBuilder.buildFor(m_docume nt);
89 m_parser->setDecoder(decoder.release()); 89 m_parser->setDecoder(decoder.release());
90 } 90 }
91 // appendBytes() can result replacing DocumentLoader::m_writer. 91 // appendBytes() can result replacing DocumentLoader::m_writer.
92 RefPtr<DocumentWriter> protectingThis(this); 92 RefPtr<DocumentWriter> protectingThis(this);
93 m_parser->appendBytes(bytes, length); 93 m_parser->appendBytes(bytes, length);
94 } 94 }
95 95
96 void DocumentWriter::parserResourceMessageFilterAdded()
97 {
98 m_parser->parserResourceMessageFilterAdded();
99 }
100
96 void DocumentWriter::end() 101 void DocumentWriter::end()
97 { 102 {
98 ASSERT(m_document); 103 ASSERT(m_document);
99 104
100 // http://bugs.webkit.org/show_bug.cgi?id=10854 105 // http://bugs.webkit.org/show_bug.cgi?id=10854
101 // The frame's last ref may be removed and it can be deleted by checkComplet ed(), 106 // The frame's last ref may be removed and it can be deleted by checkComplet ed(),
102 // so we'll add a protective refcount 107 // so we'll add a protective refcount
103 RefPtr<Frame> protector(m_document->frame()); 108 RefPtr<Frame> protector(m_document->frame());
104 109
105 if (!m_parser) 110 if (!m_parser)
(...skipping 22 matching lines...) Expand all
128 decoder->setEncoding(charset, TextResourceDecoder::UserChosenEncoding); 133 decoder->setEncoding(charset, TextResourceDecoder::UserChosenEncoding);
129 } 134 }
130 135
131 void DocumentWriter::setDocumentWasLoadedAsPartOfNavigation() 136 void DocumentWriter::setDocumentWasLoadedAsPartOfNavigation()
132 { 137 {
133 ASSERT(m_parser && !m_parser->isStopped()); 138 ASSERT(m_parser && !m_parser->isStopped());
134 m_parser->setDocumentWasLoadedAsPartOfNavigation(); 139 m_parser->setDocumentWasLoadedAsPartOfNavigation();
135 } 140 }
136 141
137 } // namespace WebCore 142 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698