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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 } | 59 } |
60 | 60 |
61 | 61 |
62 TextDecoder::TextDecoder(const WTF::TextEncoding& encoding, bool fatal, bool ign
oreBOM) | 62 TextDecoder::TextDecoder(const WTF::TextEncoding& encoding, bool fatal, bool ign
oreBOM) |
63 : m_encoding(encoding) | 63 : m_encoding(encoding) |
64 , m_codec(newTextCodec(encoding)) | 64 , m_codec(newTextCodec(encoding)) |
65 , m_fatal(fatal) | 65 , m_fatal(fatal) |
66 , m_ignoreBOM(ignoreBOM) | 66 , m_ignoreBOM(ignoreBOM) |
67 , m_bomSeen(false) | 67 , m_bomSeen(false) |
68 { | 68 { |
69 ScriptWrappable::init(this); | |
70 } | 69 } |
71 | 70 |
72 TextDecoder::~TextDecoder() | 71 TextDecoder::~TextDecoder() |
73 { | 72 { |
74 } | 73 } |
75 | 74 |
76 String TextDecoder::encoding() const | 75 String TextDecoder::encoding() const |
77 { | 76 { |
78 String name = String(m_encoding.name()).lower(); | 77 String name = String(m_encoding.name()).lower(); |
79 // Where possible, encoding aliases should be handled by changes to Chromium
's ICU or Blink's WTF. | 78 // Where possible, encoding aliases should be handled by changes to Chromium
's ICU or Blink's WTF. |
(...skipping 28 matching lines...) Expand all Loading... |
108 s.remove(0); | 107 s.remove(0); |
109 } | 108 } |
110 | 109 |
111 if (flush) | 110 if (flush) |
112 m_bomSeen = false; | 111 m_bomSeen = false; |
113 | 112 |
114 return s; | 113 return s; |
115 } | 114 } |
116 | 115 |
117 } // namespace blink | 116 } // namespace blink |
OLD | NEW |