| OLD | NEW |
| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 TextResourceDecoderBuilder::createDecoderInstance(Document* document) { | 99 TextResourceDecoderBuilder::createDecoderInstance(Document* document) { |
| 100 const WTF::TextEncoding encodingFromDomain = | 100 const WTF::TextEncoding encodingFromDomain = |
| 101 getEncodingFromDomain(document->url()); | 101 getEncodingFromDomain(document->url()); |
| 102 if (LocalFrame* frame = document->frame()) { | 102 if (LocalFrame* frame = document->frame()) { |
| 103 if (Settings* settings = frame->settings()) { | 103 if (Settings* settings = frame->settings()) { |
| 104 // Disable autodetection for XML to honor the default encoding (UTF-8) for | 104 // Disable autodetection for XML to honor the default encoding (UTF-8) for |
| 105 // unlabelled documents. | 105 // unlabelled documents. |
| 106 return TextResourceDecoder::create( | 106 return TextResourceDecoder::create( |
| 107 m_mimeType, | 107 m_mimeType, |
| 108 encodingFromDomain.isValid() ? encodingFromDomain | 108 encodingFromDomain.isValid() ? encodingFromDomain |
| 109 : settings->defaultTextEncodingName(), | 109 : settings->getDefaultTextEncodingName(), |
| 110 !DOMImplementation::isXMLMIMEType(m_mimeType)); | 110 !DOMImplementation::isXMLMIMEType(m_mimeType)); |
| 111 } | 111 } |
| 112 } | 112 } |
| 113 | 113 |
| 114 return TextResourceDecoder::create(m_mimeType, encodingFromDomain); | 114 return TextResourceDecoder::create(m_mimeType, encodingFromDomain); |
| 115 } | 115 } |
| 116 | 116 |
| 117 inline void TextResourceDecoderBuilder::setupEncoding( | 117 inline void TextResourceDecoderBuilder::setupEncoding( |
| 118 TextResourceDecoder* decoder, | 118 TextResourceDecoder* decoder, |
| 119 Document* document) { | 119 Document* document) { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 createDecoderInstance(document); | 152 createDecoderInstance(document); |
| 153 setupEncoding(decoder.get(), document); | 153 setupEncoding(decoder.get(), document); |
| 154 return decoder; | 154 return decoder; |
| 155 } | 155 } |
| 156 | 156 |
| 157 void TextResourceDecoderBuilder::clear() { | 157 void TextResourceDecoderBuilder::clear() { |
| 158 m_encoding = nullAtom; | 158 m_encoding = nullAtom; |
| 159 } | 159 } |
| 160 | 160 |
| 161 } // namespace blink | 161 } // namespace blink |
| OLD | NEW |