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

Side by Side Diff: Source/core/loader/TextTrackLoader.h

Issue 1229743005: Fix virtual/override/final usage in Source/core/{fetch,loader,streams,xmlhttprequest}/. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 5 months 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/loader/SinkDocument.cpp ('k') | Source/core/loader/WorkerLoaderClientBridge.h » ('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 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 22 matching lines...) Expand all
33 #include "platform/heap/Handle.h" 33 #include "platform/heap/Handle.h"
34 #include "wtf/OwnPtr.h" 34 #include "wtf/OwnPtr.h"
35 35
36 namespace blink { 36 namespace blink {
37 37
38 class Document; 38 class Document;
39 class TextTrackLoader; 39 class TextTrackLoader;
40 40
41 class TextTrackLoaderClient : public ResourceOwner<RawResource> { 41 class TextTrackLoaderClient : public ResourceOwner<RawResource> {
42 public: 42 public:
43 virtual ~TextTrackLoaderClient() { } 43 ~TextTrackLoaderClient() override {}
44 44
45 virtual void newCuesAvailable(TextTrackLoader*) = 0; 45 virtual void newCuesAvailable(TextTrackLoader*) = 0;
46 virtual void cueLoadingCompleted(TextTrackLoader*, bool loadingFailed) = 0; 46 virtual void cueLoadingCompleted(TextTrackLoader*, bool loadingFailed) = 0;
47 virtual void newRegionsAvailable(TextTrackLoader*) = 0; 47 virtual void newRegionsAvailable(TextTrackLoader*) = 0;
48 }; 48 };
49 49
50 class TextTrackLoader final : public NoBaseWillBeGarbageCollectedFinalized<TextT rackLoader>, public ResourceOwner<RawResource>, private VTTParserClient { 50 class TextTrackLoader final : public NoBaseWillBeGarbageCollectedFinalized<TextT rackLoader>, public ResourceOwner<RawResource>, private VTTParserClient {
51 WTF_MAKE_NONCOPYABLE(TextTrackLoader); 51 WTF_MAKE_NONCOPYABLE(TextTrackLoader);
52 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(TextTrackLoader); 52 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(TextTrackLoader);
53 public: 53 public:
54 static PassOwnPtrWillBeRawPtr<TextTrackLoader> create(TextTrackLoaderClient& client, Document& document) 54 static PassOwnPtrWillBeRawPtr<TextTrackLoader> create(TextTrackLoaderClient& client, Document& document)
55 { 55 {
56 return adoptPtrWillBeNoop(new TextTrackLoader(client, document)); 56 return adoptPtrWillBeNoop(new TextTrackLoader(client, document));
57 } 57 }
58 virtual ~TextTrackLoader(); 58 ~TextTrackLoader() override;
59 59
60 bool load(const KURL&, const AtomicString& crossOriginMode); 60 bool load(const KURL&, const AtomicString& crossOriginMode);
61 void cancelLoad(); 61 void cancelLoad();
62 62
63 enum State { Idle, Loading, Finished, Failed }; 63 enum State { Idle, Loading, Finished, Failed };
64 State loadState() { return m_state; } 64 State loadState() { return m_state; }
65 65
66 void getNewCues(WillBeHeapVector<RefPtrWillBeMember<TextTrackCue>>& outputCu es); 66 void getNewCues(WillBeHeapVector<RefPtrWillBeMember<TextTrackCue>>& outputCu es);
67 void getNewRegions(WillBeHeapVector<RefPtrWillBeMember<VTTRegion>>& outputRe gions); 67 void getNewRegions(WillBeHeapVector<RefPtrWillBeMember<VTTRegion>>& outputRe gions);
68 68
69 DECLARE_TRACE(); 69 DECLARE_TRACE();
70 70
71 private: 71 private:
72 // RawResourceClient 72 // RawResourceClient
73 virtual void dataReceived(Resource*, const char* data, unsigned length) over ride; 73 void dataReceived(Resource*, const char* data, unsigned length) override;
74 virtual void notifyFinished(Resource*) override; 74 void notifyFinished(Resource*) override;
75 75
76 // VTTParserClient 76 // VTTParserClient
77 virtual void newCuesParsed() override; 77 void newCuesParsed() override;
78 virtual void newRegionsParsed() override; 78 void newRegionsParsed() override;
79 virtual void fileFailedToParse() override; 79 void fileFailedToParse() override;
80 80
81 TextTrackLoader(TextTrackLoaderClient&, Document&); 81 TextTrackLoader(TextTrackLoaderClient&, Document&);
82 82
83 void cueLoadTimerFired(Timer<TextTrackLoader>*); 83 void cueLoadTimerFired(Timer<TextTrackLoader>*);
84 void corsPolicyPreventedLoad(SecurityOrigin*, const KURL&); 84 void corsPolicyPreventedLoad(SecurityOrigin*, const KURL&);
85 85
86 Document& document() const { return *m_document; } 86 Document& document() const { return *m_document; }
87 87
88 TextTrackLoaderClient& m_client; 88 TextTrackLoaderClient& m_client;
89 OwnPtrWillBeMember<VTTParser> m_cueParser; 89 OwnPtrWillBeMember<VTTParser> m_cueParser;
90 // FIXME: Remove this pointer and get the Document from m_client. 90 // FIXME: Remove this pointer and get the Document from m_client.
91 RawPtrWillBeMember<Document> m_document; 91 RawPtrWillBeMember<Document> m_document;
92 Timer<TextTrackLoader> m_cueLoadTimer; 92 Timer<TextTrackLoader> m_cueLoadTimer;
93 State m_state; 93 State m_state;
94 bool m_newCuesAvailable; 94 bool m_newCuesAvailable;
95 }; 95 };
96 96
97 } // namespace blink 97 } // namespace blink
98 98
99 #endif 99 #endif
OLDNEW
« no previous file with comments | « Source/core/loader/SinkDocument.cpp ('k') | Source/core/loader/WorkerLoaderClientBridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698