OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple, Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple, 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 24 matching lines...) Expand all Loading... |
35 namespace WTF { | 35 namespace WTF { |
36 | 36 |
37 void TextCodecUserDefined::registerEncodingNames( | 37 void TextCodecUserDefined::registerEncodingNames( |
38 EncodingNameRegistrar registrar) { | 38 EncodingNameRegistrar registrar) { |
39 registrar("x-user-defined", "x-user-defined"); | 39 registrar("x-user-defined", "x-user-defined"); |
40 } | 40 } |
41 | 41 |
42 static std::unique_ptr<TextCodec> newStreamingTextDecoderUserDefined( | 42 static std::unique_ptr<TextCodec> newStreamingTextDecoderUserDefined( |
43 const TextEncoding&, | 43 const TextEncoding&, |
44 const void*) { | 44 const void*) { |
45 return wrapUnique(new TextCodecUserDefined); | 45 return WTF::wrapUnique(new TextCodecUserDefined); |
46 } | 46 } |
47 | 47 |
48 void TextCodecUserDefined::registerCodecs(TextCodecRegistrar registrar) { | 48 void TextCodecUserDefined::registerCodecs(TextCodecRegistrar registrar) { |
49 registrar("x-user-defined", newStreamingTextDecoderUserDefined, 0); | 49 registrar("x-user-defined", newStreamingTextDecoderUserDefined, 0); |
50 } | 50 } |
51 | 51 |
52 String TextCodecUserDefined::decode(const char* bytes, | 52 String TextCodecUserDefined::decode(const char* bytes, |
53 size_t length, | 53 size_t length, |
54 FlushBehavior, | 54 FlushBehavior, |
55 bool, | 55 bool, |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 return encodeCommon(characters, length, handling); | 137 return encodeCommon(characters, length, handling); |
138 } | 138 } |
139 | 139 |
140 CString TextCodecUserDefined::encode(const LChar* characters, | 140 CString TextCodecUserDefined::encode(const LChar* characters, |
141 size_t length, | 141 size_t length, |
142 UnencodableHandling handling) { | 142 UnencodableHandling handling) { |
143 return encodeCommon(characters, length, handling); | 143 return encodeCommon(characters, length, handling); |
144 } | 144 } |
145 | 145 |
146 } // namespace WTF | 146 } // namespace WTF |
OLD | NEW |