Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: Source/core/html/track/vtt/VTTTokenizer.h

Issue 78833002: Remove state-specific appendTo*/begin* methods from VTTToken (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/html/track/vtt/VTTToken.h ('k') | Source/core/html/track/vtt/VTTTokenizer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 explicit VTTTokenizer(const String& input); 58 explicit VTTTokenizer(const String& input);
59 59
60 typedef VTTTokenizerState State; 60 typedef VTTTokenizerState State;
61 61
62 void reset(); 62 void reset();
63 63
64 bool nextToken(VTTToken&); 64 bool nextToken(VTTToken&);
65 65
66 inline bool haveBufferedCharacterToken() { return false; } 66 inline bool haveBufferedCharacterToken() { return false; }
67 67
68 inline void bufferCharacter(UChar character)
69 {
70 ASSERT(character != kEndOfFileMarker);
71 m_token->appendToCharacter(character);
72 }
73
74 inline bool advanceAndEmitToken(SegmentedString& source, VTTTokenTypes::Type type) 68 inline bool advanceAndEmitToken(SegmentedString& source, VTTTokenTypes::Type type)
75 { 69 {
76 source.advanceAndUpdateLineNumber(); 70 source.advanceAndUpdateLineNumber();
77 return emitToken(type); 71 return emitToken(type);
78 } 72 }
79 73
80 inline bool emitToken(VTTTokenTypes::Type type) 74 inline bool emitToken(VTTTokenTypes::Type type)
81 { 75 {
82 m_token->setType(type); 76 m_token->setType(type);
83 return true; 77 return true;
(...skipping 13 matching lines...) Expand all
97 StringBuilder m_buffer; 91 StringBuilder m_buffer;
98 SegmentedString m_input; 92 SegmentedString m_input;
99 93
100 // ://www.whatwg.org/specs/web-apps/current-work/#preprocessing-the-input-st ream 94 // ://www.whatwg.org/specs/web-apps/current-work/#preprocessing-the-input-st ream
101 InputStreamPreprocessor<VTTTokenizer> m_inputStreamPreprocessor; 95 InputStreamPreprocessor<VTTTokenizer> m_inputStreamPreprocessor;
102 }; 96 };
103 97
104 } 98 }
105 99
106 #endif 100 #endif
OLDNEW
« no previous file with comments | « Source/core/html/track/vtt/VTTToken.h ('k') | Source/core/html/track/vtt/VTTTokenizer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698