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

Side by Side Diff: Source/core/html/track/WebVTTParser.h

Issue 63173020: Split VTTCue from TextTrackCue (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/track/VTTCue.idl ('k') | Source/core/html/track/WebVTTParser.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 18 matching lines...) Expand all
29 */ 29 */
30 30
31 #ifndef WebVTTParser_h 31 #ifndef WebVTTParser_h
32 #define WebVTTParser_h 32 #define WebVTTParser_h
33 33
34 #include "HTMLNames.h" 34 #include "HTMLNames.h"
35 #include "RuntimeEnabledFeatures.h" 35 #include "RuntimeEnabledFeatures.h"
36 #include "core/dom/DocumentFragment.h" 36 #include "core/dom/DocumentFragment.h"
37 #include "core/fetch/TextResourceDecoder.h" 37 #include "core/fetch/TextResourceDecoder.h"
38 #include "core/html/track/BufferedLineReader.h" 38 #include "core/html/track/BufferedLineReader.h"
39 #include "core/html/track/TextTrackCue.h" 39 #include "core/html/track/VTTCue.h"
40 #include "core/html/track/VTTRegion.h" 40 #include "core/html/track/VTTRegion.h"
41 #include "core/html/track/WebVTTTokenizer.h" 41 #include "core/html/track/WebVTTTokenizer.h"
42 #include "wtf/PassOwnPtr.h" 42 #include "wtf/PassOwnPtr.h"
43 #include "wtf/text/StringBuilder.h" 43 #include "wtf/text/StringBuilder.h"
44 44
45 namespace WebCore { 45 namespace WebCore {
46 46
47 using namespace HTMLNames; 47 using namespace HTMLNames;
48 48
49 class Document; 49 class Document;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 static FloatPoint parseFloatPercentageValuePair(const String&, char, bool&); 102 static FloatPoint parseFloatPercentageValuePair(const String&, char, bool&);
103 103
104 // Create the DocumentFragment representation of the WebVTT cue text. 104 // Create the DocumentFragment representation of the WebVTT cue text.
105 static PassRefPtr<DocumentFragment> createDocumentFragmentFromCueText(Docume nt&, const String&); 105 static PassRefPtr<DocumentFragment> createDocumentFragmentFromCueText(Docume nt&, const String&);
106 106
107 // Input data to the parser to parse. 107 // Input data to the parser to parse.
108 void parseBytes(const char* data, unsigned length); 108 void parseBytes(const char* data, unsigned length);
109 void flush(); 109 void flush();
110 110
111 // Transfers ownership of last parsed cues to caller. 111 // Transfers ownership of last parsed cues to caller.
112 void getNewCues(Vector<RefPtr<TextTrackCue> >&); 112 void getNewCues(Vector<RefPtr<VTTCue> >&);
113 void getNewRegions(Vector<RefPtr<VTTRegion> >&); 113 void getNewRegions(Vector<RefPtr<VTTRegion> >&);
114 114
115 private: 115 private:
116 WebVTTParser(WebVTTParserClient*, Document&); 116 WebVTTParser(WebVTTParserClient*, Document&);
117 117
118 Document* m_document; 118 Document* m_document;
119 ParseState m_state; 119 ParseState m_state;
120 120
121 void parse(); 121 void parse();
122 void flushPendingCue(); 122 void flushPendingCue();
(...skipping 14 matching lines...) Expand all
137 BufferedLineReader m_lineReader; 137 BufferedLineReader m_lineReader;
138 RefPtr<TextResourceDecoder> m_decoder; 138 RefPtr<TextResourceDecoder> m_decoder;
139 String m_currentId; 139 String m_currentId;
140 double m_currentStartTime; 140 double m_currentStartTime;
141 double m_currentEndTime; 141 double m_currentEndTime;
142 StringBuilder m_currentContent; 142 StringBuilder m_currentContent;
143 String m_currentSettings; 143 String m_currentSettings;
144 144
145 WebVTTParserClient* m_client; 145 WebVTTParserClient* m_client;
146 146
147 Vector<RefPtr<TextTrackCue> > m_cuelist; 147 Vector<RefPtr<VTTCue> > m_cuelist;
148 148
149 Vector<RefPtr<VTTRegion> > m_regionList; 149 Vector<RefPtr<VTTRegion> > m_regionList;
150 }; 150 };
151 151
152 } // namespace WebCore 152 } // namespace WebCore
153 153
154 #endif 154 #endif
OLDNEW
« no previous file with comments | « Source/core/html/track/VTTCue.idl ('k') | Source/core/html/track/WebVTTParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698