| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 TextResourceDecoder(const String& mimeType, const TextEncoding& defaultEncod
ing, | 67 TextResourceDecoder(const String& mimeType, const TextEncoding& defaultEncod
ing, |
| 68 bool usesEncodingDetector); | 68 bool usesEncodingDetector); |
| 69 | 69 |
| 70 enum ContentType { PlainText, HTML, XML, CSS }; // PlainText only checks for
BOM. | 70 enum ContentType { PlainText, HTML, XML, CSS }; // PlainText only checks for
BOM. |
| 71 static ContentType determineContentType(const String& mimeType); | 71 static ContentType determineContentType(const String& mimeType); |
| 72 static const TextEncoding& defaultEncoding(ContentType, const TextEncoding&
defaultEncoding); | 72 static const TextEncoding& defaultEncoding(ContentType, const TextEncoding&
defaultEncoding); |
| 73 | 73 |
| 74 size_t checkForBOM(const char*, size_t); | 74 size_t checkForBOM(const char*, size_t); |
| 75 bool checkForCSSCharset(const char*, size_t, bool& movedDataToBuffer); | 75 bool checkForCSSCharset(const char*, size_t, bool& movedDataToBuffer); |
| 76 bool checkForHeadCharset(const char*, size_t, bool& movedDataToBuffer); | 76 bool checkForHeadCharset(const char*, size_t, bool& movedDataToBuffer); |
| 77 #if !PLATFORM(CHROMIUM) |
| 77 void detectJapaneseEncoding(const char*, size_t); | 78 void detectJapaneseEncoding(const char*, size_t); |
| 79 #endif |
| 78 bool shouldAutoDetect() const; | 80 bool shouldAutoDetect() const; |
| 79 | 81 |
| 80 ContentType m_contentType; | 82 ContentType m_contentType; |
| 81 TextEncoding m_encoding; | 83 TextEncoding m_encoding; |
| 82 OwnPtr<TextCodec> m_codec; | 84 OwnPtr<TextCodec> m_codec; |
| 83 EncodingSource m_source; | 85 EncodingSource m_source; |
| 84 const char* m_hintEncoding; | 86 const char* m_hintEncoding; |
| 85 Vector<char> m_buffer; | 87 Vector<char> m_buffer; |
| 86 bool m_checkedForBOM; | 88 bool m_checkedForBOM; |
| 87 bool m_checkedForCSSCharset; | 89 bool m_checkedForCSSCharset; |
| 88 bool m_checkedForHeadCharset; | 90 bool m_checkedForHeadCharset; |
| 89 bool m_useLenientXMLDecoding; // Don't stop on XML decoding errors. | 91 bool m_useLenientXMLDecoding; // Don't stop on XML decoding errors. |
| 90 bool m_sawError; | 92 bool m_sawError; |
| 91 bool m_usesEncodingDetector; | 93 bool m_usesEncodingDetector; |
| 92 }; | 94 }; |
| 93 | 95 |
| 94 } | 96 } |
| 95 | 97 |
| 96 #endif | 98 #endif |
| OLD | NEW |