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

Side by Side Diff: third_party/WebKit/Source/modules/fetch/FetchDataLoader.cpp

Issue 1470893002: [Fetch] Always use utf-8 for decoding in text() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reflect comments. Created 5 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
« no previous file with comments | « third_party/WebKit/Source/core/html/parser/TextResourceDecoder.cpp ('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
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/parser/TextResourceDecoder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698