OLD | NEW |
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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 m_parser->setDecoder(decoder.release()); | 112 m_parser->setDecoder(decoder.release()); |
113 } | 113 } |
114 | 114 |
115 // finish() can result replacing DocumentLoader::m_writer. | 115 // finish() can result replacing DocumentLoader::m_writer. |
116 RefPtrWillBeRawPtr<DocumentWriter> protectingThis(this); | 116 RefPtrWillBeRawPtr<DocumentWriter> protectingThis(this); |
117 m_parser->finish(); | 117 m_parser->finish(); |
118 m_parser = nullptr; | 118 m_parser = nullptr; |
119 m_document = nullptr; | 119 m_document = nullptr; |
120 } | 120 } |
121 | 121 |
122 void DocumentWriter::setUserChosenEncoding(const String& charset) | |
123 { | |
124 TextResourceDecoder* decoder = m_parser->decoder(); | |
125 if (decoder) | |
126 decoder->setEncoding(charset, TextResourceDecoder::UserChosenEncoding); | |
127 } | |
128 | |
129 void DocumentWriter::setDocumentWasLoadedAsPartOfNavigation() | 122 void DocumentWriter::setDocumentWasLoadedAsPartOfNavigation() |
130 { | 123 { |
131 ASSERT(m_parser && !m_parser->isStopped()); | 124 ASSERT(m_parser && !m_parser->isStopped()); |
132 m_parser->setDocumentWasLoadedAsPartOfNavigation(); | 125 m_parser->setDocumentWasLoadedAsPartOfNavigation(); |
133 } | 126 } |
134 | 127 |
135 } // namespace blink | 128 } // namespace blink |
OLD | NEW |