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

Side by Side Diff: Source/core/html/imports/HTMLImportLoader.cpp

Issue 178883002: Set encoding to UTF-8 for HTML Imports if no encoding is specified in the HTTP response (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Merged to trunk Created 6 years, 8 months 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/http/tests/htmlimports/resources/no-encoding.cgi ('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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 101
102 setState(finishWriting()); 102 setState(finishWriting());
103 } 103 }
104 104
105 HTMLImportLoader::State HTMLImportLoader::startWritingAndParsing(const ResourceR esponse& response) 105 HTMLImportLoader::State HTMLImportLoader::startWritingAndParsing(const ResourceR esponse& response)
106 { 106 {
107 ASSERT(!m_imports.isEmpty()); 107 ASSERT(!m_imports.isEmpty());
108 DocumentInit init = DocumentInit(response.url(), 0, m_controller->master()-> contextDocument(), m_controller) 108 DocumentInit init = DocumentInit(response.url(), 0, m_controller->master()-> contextDocument(), m_controller)
109 .withRegistrationContext(m_controller->master()->registrationContext()); 109 .withRegistrationContext(m_controller->master()->registrationContext());
110 m_importedDocument = HTMLDocument::create(init); 110 m_importedDocument = HTMLDocument::create(init);
111 m_writer = DocumentWriter::create(m_importedDocument.get(), response.mimeTyp e(), response.textEncodingName()); 111 m_writer = DocumentWriter::create(m_importedDocument.get(), response.mimeTyp e(), "UTF-8");
112 112
113 return StateLoading; 113 return StateLoading;
114 } 114 }
115 115
116 HTMLImportLoader::State HTMLImportLoader::finishWriting() 116 HTMLImportLoader::State HTMLImportLoader::finishWriting()
117 { 117 {
118 return StateWritten; 118 return StateWritten;
119 } 119 }
120 120
121 HTMLImportLoader::State HTMLImportLoader::finishParsing() 121 HTMLImportLoader::State HTMLImportLoader::finishParsing()
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 client->didFinishLoading(); 188 client->didFinishLoading();
189 } 189 }
190 190
191 void HTMLImportLoader::removeImport(HTMLImportChild* client) 191 void HTMLImportLoader::removeImport(HTMLImportChild* client)
192 { 192 {
193 ASSERT(kNotFound != m_imports.find(client)); 193 ASSERT(kNotFound != m_imports.find(client));
194 m_imports.remove(m_imports.find(client)); 194 m_imports.remove(m_imports.find(client));
195 } 195 }
196 196
197 } // namespace WebCore 197 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/htmlimports/resources/no-encoding.cgi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698