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

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

Issue 75243004: Replace character vectors with StringBuilders in the WebVTT tokenizer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase after symbolnames changed 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 16 matching lines...) Expand all
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef VTTTokenizer_h 31 #ifndef VTTTokenizer_h
32 #define VTTTokenizer_h 32 #define VTTTokenizer_h
33 33
34 #include "core/html/parser/InputStreamPreprocessor.h" 34 #include "core/html/parser/InputStreamPreprocessor.h"
35 #include "core/html/track/vtt/VTTToken.h" 35 #include "core/html/track/vtt/VTTToken.h"
36 #include "wtf/PassOwnPtr.h" 36 #include "wtf/PassOwnPtr.h"
37 #include "wtf/text/StringBuilder.h"
37 38
38 namespace WebCore { 39 namespace WebCore {
39 40
40 class VTTTokenizerState { 41 class VTTTokenizerState {
41 public: 42 public:
42 enum State { 43 enum State {
43 DataState, 44 DataState,
44 EscapeState, 45 EscapeState,
45 TagState, 46 TagState,
46 StartTagState, 47 StartTagState,
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 VTTTokenizer(); 95 VTTTokenizer();
95 96
96 // m_token is owned by the caller. If nextToken is not on the stack, 97 // m_token is owned by the caller. If nextToken is not on the stack,
97 // this member might be pointing to unallocated memory. 98 // this member might be pointing to unallocated memory.
98 VTTToken* m_token; 99 VTTToken* m_token;
99 100
100 // This member does not really need to be an instance member - it's only use d in nextToken. 101 // This member does not really need to be an instance member - it's only use d in nextToken.
101 // The reason it's stored here is because of the use of the ADVANCE_TO state helpers. 102 // The reason it's stored here is because of the use of the ADVANCE_TO state helpers.
102 VTTTokenizerState::State m_state; 103 VTTTokenizerState::State m_state;
103 104
104 Vector<LChar, 32> m_buffer; 105 StringBuilder m_buffer;
105 106
106 // ://www.whatwg.org/specs/web-apps/current-work/#preprocessing-the-input-st ream 107 // ://www.whatwg.org/specs/web-apps/current-work/#preprocessing-the-input-st ream
107 InputStreamPreprocessor<VTTTokenizer> m_inputStreamPreprocessor; 108 InputStreamPreprocessor<VTTTokenizer> m_inputStreamPreprocessor;
108 }; 109 };
109 110
110 } 111 }
111 112
112 #endif 113 #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