OLD | NEW |
1 /* | 1 /* |
2 Copyright (C) 1999 Lars Knoll (knoll@mpi-hd.mpg.de) | 2 Copyright (C) 1999 Lars Knoll (knoll@mpi-hd.mpg.de) |
3 Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 3 Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
4 Copyright (C) 2006, 2008 Apple Inc. All rights reserved. | 4 Copyright (C) 2006, 2008 Apple Inc. All rights reserved. |
5 | 5 |
6 This library is free software; you can redistribute it and/or | 6 This library is free software; you can redistribute it and/or |
7 modify it under the terms of the GNU Library General Public | 7 modify it under the terms of the GNU Library General Public |
8 License as published by the Free Software Foundation; either | 8 License as published by the Free Software Foundation; either |
9 version 2 of the License, or (at your option) any later version. | 9 version 2 of the License, or (at your option) any later version. |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 EncodingFromMetaTag, | 44 EncodingFromMetaTag, |
45 EncodingFromCSSCharset, | 45 EncodingFromCSSCharset, |
46 EncodingFromHTTPHeader, | 46 EncodingFromHTTPHeader, |
47 EncodingFromParentFrame | 47 EncodingFromParentFrame |
48 }; | 48 }; |
49 | 49 |
50 static std::unique_ptr<TextResourceDecoder> create(const String& mimeType, c
onst WTF::TextEncoding& defaultEncoding = WTF::TextEncoding(), bool usesEncoding
Detector = false) | 50 static std::unique_ptr<TextResourceDecoder> create(const String& mimeType, c
onst WTF::TextEncoding& defaultEncoding = WTF::TextEncoding(), bool usesEncoding
Detector = false) |
51 { | 51 { |
52 return wrapUnique(new TextResourceDecoder(mimeType, defaultEncoding, use
sEncodingDetector ? UseAllAutoDetection : UseContentAndBOMBasedDetection)); | 52 return wrapUnique(new TextResourceDecoder(mimeType, defaultEncoding, use
sEncodingDetector ? UseAllAutoDetection : UseContentAndBOMBasedDetection)); |
53 } | 53 } |
| 54 |
54 // Corresponds to utf-8 decode in Encoding spec: | 55 // Corresponds to utf-8 decode in Encoding spec: |
55 // https://encoding.spec.whatwg.org/#utf-8-decode. | 56 // https://encoding.spec.whatwg.org/#utf-8-decode. |
56 static std::unique_ptr<TextResourceDecoder> createAlwaysUseUTF8ForText() | 57 static std::unique_ptr<TextResourceDecoder> createAlwaysUseUTF8ForText() |
57 { | 58 { |
58 return wrapUnique(new TextResourceDecoder("plain/text", UTF8Encoding(),
AlwaysUseUTF8ForText)); | 59 return wrapUnique(new TextResourceDecoder("plain/text", UTF8Encoding(),
AlwaysUseUTF8ForText)); |
59 } | 60 } |
60 ~TextResourceDecoder(); | 61 ~TextResourceDecoder(); |
61 | 62 |
62 void setEncoding(const WTF::TextEncoding&, EncodingSource); | 63 void setEncoding(const WTF::TextEncoding&, EncodingSource); |
63 const WTF::TextEncoding& encoding() const { return m_encoding; } | 64 const WTF::TextEncoding& encoding() const { return m_encoding; } |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 bool m_useLenientXMLDecoding; // Don't stop on XML decoding errors. | 126 bool m_useLenientXMLDecoding; // Don't stop on XML decoding errors. |
126 bool m_sawError; | 127 bool m_sawError; |
127 EncodingDetectionOption m_encodingDetectionOption; | 128 EncodingDetectionOption m_encodingDetectionOption; |
128 | 129 |
129 std::unique_ptr<HTMLMetaCharsetParser> m_charsetParser; | 130 std::unique_ptr<HTMLMetaCharsetParser> m_charsetParser; |
130 }; | 131 }; |
131 | 132 |
132 } // namespace blink | 133 } // namespace blink |
133 | 134 |
134 #endif | 135 #endif |
OLD | NEW |