| 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 29 matching lines...) Expand all Loading... |
| 40 #include "core/html/track/vtt/VTTTokenizer.h" | 40 #include "core/html/track/vtt/VTTTokenizer.h" |
| 41 #include "platform/heap/Handle.h" | 41 #include "platform/heap/Handle.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 blink { | 45 namespace blink { |
| 46 | 46 |
| 47 class Document; | 47 class Document; |
| 48 class VTTScanner; | 48 class VTTScanner; |
| 49 | 49 |
| 50 class VTTParserClient { | 50 class VTTParserClient : public GarbageCollectedMixin { |
| 51 public: | 51 public: |
| 52 virtual ~VTTParserClient() { } | 52 virtual ~VTTParserClient() { } |
| 53 | 53 |
| 54 virtual void newCuesParsed() = 0; | 54 virtual void newCuesParsed() = 0; |
| 55 virtual void newRegionsParsed() = 0; | 55 virtual void newRegionsParsed() = 0; |
| 56 virtual void fileFailedToParse() = 0; | 56 virtual void fileFailedToParse() = 0; |
| 57 |
| 58 DEFINE_INLINE_VIRTUAL_TRACE() { } |
| 57 }; | 59 }; |
| 58 | 60 |
| 59 class VTTParser final : public GarbageCollectedFinalized<VTTParser> { | 61 class VTTParser final : public GarbageCollectedFinalized<VTTParser> { |
| 60 public: | 62 public: |
| 61 enum ParseState { | 63 enum ParseState { |
| 62 Initial, | 64 Initial, |
| 63 Header, | 65 Header, |
| 64 Id, | 66 Id, |
| 65 TimingsAndSettings, | 67 TimingsAndSettings, |
| 66 CueText, | 68 CueText, |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 static bool collectTimeStamp(VTTScanner& input, double& timeStamp); | 139 static bool collectTimeStamp(VTTScanner& input, double& timeStamp); |
| 138 | 140 |
| 139 BufferedLineReader m_lineReader; | 141 BufferedLineReader m_lineReader; |
| 140 OwnPtr<TextResourceDecoder> m_decoder; | 142 OwnPtr<TextResourceDecoder> m_decoder; |
| 141 AtomicString m_currentId; | 143 AtomicString m_currentId; |
| 142 double m_currentStartTime; | 144 double m_currentStartTime; |
| 143 double m_currentEndTime; | 145 double m_currentEndTime; |
| 144 StringBuilder m_currentContent; | 146 StringBuilder m_currentContent; |
| 145 String m_currentSettings; | 147 String m_currentSettings; |
| 146 | 148 |
| 147 VTTParserClient* m_client; | 149 Member<VTTParserClient> m_client; |
| 148 | 150 |
| 149 HeapVector<Member<TextTrackCue>> m_cueList; | 151 HeapVector<Member<TextTrackCue>> m_cueList; |
| 150 | 152 |
| 151 HeapVector<Member<VTTRegion>> m_regionList; | 153 HeapVector<Member<VTTRegion>> m_regionList; |
| 152 }; | 154 }; |
| 153 | 155 |
| 154 } // namespace blink | 156 } // namespace blink |
| 155 | 157 |
| 156 #endif | 158 #endif |
| OLD | NEW |