OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 enum State { Idle, Loading, Finished, Failed }; | 65 enum State { Idle, Loading, Finished, Failed }; |
66 State loadState() { return m_state; } | 66 State loadState() { return m_state; } |
67 | 67 |
68 void getNewCues(HeapVector<Member<TextTrackCue>>& outputCues); | 68 void getNewCues(HeapVector<Member<TextTrackCue>>& outputCues); |
69 void getNewRegions(HeapVector<Member<VTTRegion>>& outputRegions); | 69 void getNewRegions(HeapVector<Member<VTTRegion>>& outputRegions); |
70 | 70 |
71 DECLARE_TRACE(); | 71 DECLARE_TRACE(); |
72 | 72 |
73 private: | 73 private: |
74 // RawResourceClient | 74 // RawResourceClient |
75 void redirectReceived(Resource*, | 75 bool redirectReceived(Resource*, |
76 ResourceRequest&, | 76 const ResourceRequest&, |
77 const ResourceResponse&) override; | 77 const ResourceResponse&) override; |
78 void dataReceived(Resource*, const char* data, size_t length) override; | 78 void dataReceived(Resource*, const char* data, size_t length) override; |
79 void notifyFinished(Resource*) override; | 79 void notifyFinished(Resource*) override; |
80 String debugName() const override { return "TextTrackLoader"; } | 80 String debugName() const override { return "TextTrackLoader"; } |
81 | 81 |
82 // VTTParserClient | 82 // VTTParserClient |
83 void newCuesParsed() override; | 83 void newCuesParsed() override; |
84 void newRegionsParsed() override; | 84 void newRegionsParsed() override; |
85 void fileFailedToParse() override; | 85 void fileFailedToParse() override; |
86 | 86 |
87 TextTrackLoader(TextTrackLoaderClient&, Document&); | 87 TextTrackLoader(TextTrackLoaderClient&, Document&); |
88 | 88 |
89 void cueLoadTimerFired(TimerBase*); | 89 void cueLoadTimerFired(TimerBase*); |
90 void corsPolicyPreventedLoad(SecurityOrigin*, const KURL&); | 90 void corsPolicyPreventedLoad(SecurityOrigin*, const KURL&); |
91 | 91 |
92 Document& document() const { return *m_document; } | 92 Document& document() const { return *m_document; } |
93 | 93 |
94 Member<TextTrackLoaderClient> m_client; | 94 Member<TextTrackLoaderClient> m_client; |
95 Member<VTTParser> m_cueParser; | 95 Member<VTTParser> m_cueParser; |
96 // FIXME: Remove this pointer and get the Document from m_client. | 96 // FIXME: Remove this pointer and get the Document from m_client. |
97 Member<Document> m_document; | 97 Member<Document> m_document; |
98 Timer<TextTrackLoader> m_cueLoadTimer; | 98 Timer<TextTrackLoader> m_cueLoadTimer; |
99 State m_state; | 99 State m_state; |
100 bool m_newCuesAvailable; | 100 bool m_newCuesAvailable; |
101 }; | 101 }; |
102 | 102 |
103 } // namespace blink | 103 } // namespace blink |
104 | 104 |
105 #endif | 105 #endif |
OLD | NEW |