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 #include "config.h" | 5 #include "config.h" |
6 #include "modules/fetch/FetchDataLoader.h" | 6 #include "modules/fetch/FetchDataLoader.h" |
7 | 7 |
8 #include "core/html/parser/TextResourceDecoder.h" | 8 #include "core/html/parser/TextResourceDecoder.h" |
9 #include "wtf/ArrayBufferBuilder.h" | 9 #include "wtf/ArrayBufferBuilder.h" |
10 #include "wtf/text/StringBuilder.h" | 10 #include "wtf/text/StringBuilder.h" |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 visitor->trace(m_client); | 211 visitor->trace(m_client); |
212 } | 212 } |
213 | 213 |
214 protected: | 214 protected: |
215 void start(FetchDataConsumerHandle* handle, FetchDataLoader::Client* client)
override | 215 void start(FetchDataConsumerHandle* handle, FetchDataLoader::Client* client)
override |
216 { | 216 { |
217 ASSERT(!m_client); | 217 ASSERT(!m_client); |
218 ASSERT(!m_decoder); | 218 ASSERT(!m_decoder); |
219 ASSERT(!m_reader); | 219 ASSERT(!m_reader); |
220 m_client = client; | 220 m_client = client; |
221 m_decoder = TextResourceDecoder::create("text/plain", UTF8Encoding()); | 221 m_decoder = TextResourceDecoder::createAlwaysUseUTF8ForText(); |
222 m_reader = handle->obtainReader(this); | 222 m_reader = handle->obtainReader(this); |
223 } | 223 } |
224 | 224 |
225 void didGetReadable() override | 225 void didGetReadable() override |
226 { | 226 { |
227 ASSERT(m_client); | 227 ASSERT(m_client); |
228 ASSERT(m_decoder); | 228 ASSERT(m_decoder); |
229 ASSERT(m_reader); | 229 ASSERT(m_reader); |
230 | 230 |
231 while (true) { | 231 while (true) { |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 { | 393 { |
394 return new FetchDataLoaderAsString(); | 394 return new FetchDataLoaderAsString(); |
395 } | 395 } |
396 | 396 |
397 FetchDataLoader* FetchDataLoader::createLoaderAsStream(Stream* outStream) | 397 FetchDataLoader* FetchDataLoader::createLoaderAsStream(Stream* outStream) |
398 { | 398 { |
399 return new FetchDataLoaderAsStream(outStream); | 399 return new FetchDataLoaderAsStream(outStream); |
400 } | 400 } |
401 | 401 |
402 } // namespace blink | 402 } // namespace blink |
OLD | NEW |