OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 UChar cc = m_inputStreamPreprocessor.nextInputCharacter(); | 77 UChar cc = m_inputStreamPreprocessor.nextInputCharacter(); |
78 | 78 |
79 // 4.8.10.13.4 WebVTT cue text tokenizer | 79 // 4.8.10.13.4 WebVTT cue text tokenizer |
80 switch (m_state) { | 80 switch (m_state) { |
81 WEBVTT_BEGIN_STATE(DataState) { | 81 WEBVTT_BEGIN_STATE(DataState) { |
82 if (cc == '&') { | 82 if (cc == '&') { |
83 m_buffer.append(static_cast<LChar>(cc)); | 83 m_buffer.append(static_cast<LChar>(cc)); |
84 WEBVTT_ADVANCE_TO(EscapeState); | 84 WEBVTT_ADVANCE_TO(EscapeState); |
85 } else if (cc == '<') { | 85 } else if (cc == '<') { |
| 86 // FIXME: the explicit Vector conversion copies into a temporary |
| 87 // and is wasteful. |
86 if (m_token->type() == WebVTTTokenTypes::Uninitialized | 88 if (m_token->type() == WebVTTTokenTypes::Uninitialized |
87 || vectorEqualsString<UChar>(m_token->characters(), emptyString(
))) | 89 || vectorEqualsString<UChar>(Vector<UChar, 32>(m_token->characte
rs()), emptyString())) |
88 WEBVTT_ADVANCE_TO(TagState); | 90 WEBVTT_ADVANCE_TO(TagState); |
89 else | 91 else |
90 return emitAndResumeIn(source, WebVTTTokenizerState::TagState); | 92 return emitAndResumeIn(source, WebVTTTokenizerState::TagState); |
91 } else if (cc == kEndOfFileMarker) | 93 } else if (cc == kEndOfFileMarker) |
92 return emitEndOfFile(source); | 94 return emitEndOfFile(source); |
93 else { | 95 else { |
94 bufferCharacter(cc); | 96 bufferCharacter(cc); |
95 WEBVTT_ADVANCE_TO(DataState); | 97 WEBVTT_ADVANCE_TO(DataState); |
96 } | 98 } |
97 } | 99 } |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 END_STATE() | 219 END_STATE() |
218 | 220 |
219 } | 221 } |
220 | 222 |
221 ASSERT_NOT_REACHED(); | 223 ASSERT_NOT_REACHED(); |
222 return false; | 224 return false; |
223 } | 225 } |
224 | 226 |
225 } | 227 } |
226 | 228 |
OLD | NEW |