Revert of Roll src/third_party/WebKit e0eac24:489c548 (svn 193311:193320) (patchset...
[chromium-blink-merge.git] / media / blink / texttrack_impl.h
blob70c6a2257f46150feddaf429409754302e78bc3c
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef MEDIA_BLINK_TEXTTRACK_IMPL_H_
6 #define MEDIA_BLINK_TEXTTRACK_IMPL_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "media/base/text_track.h"
14 namespace base {
15 class SingleThreadTaskRunner;
18 namespace blink {
19 class WebInbandTextTrackClient;
20 class WebMediaPlayerClient;
23 namespace media {
25 class WebInbandTextTrackImpl;
27 class TextTrackImpl : public TextTrack {
28 public:
29 // Constructor assumes ownership of the |text_track| object.
30 TextTrackImpl(const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
31 blink::WebMediaPlayerClient* client,
32 scoped_ptr<WebInbandTextTrackImpl> text_track);
34 ~TextTrackImpl() override;
36 void addWebVTTCue(const base::TimeDelta& start,
37 const base::TimeDelta& end,
38 const std::string& id,
39 const std::string& content,
40 const std::string& settings) override;
42 private:
43 static void OnAddCue(WebInbandTextTrackImpl* text_track,
44 const base::TimeDelta& start,
45 const base::TimeDelta& end,
46 const std::string& id,
47 const std::string& content,
48 const std::string& settings);
50 static void OnRemoveTrack(blink::WebMediaPlayerClient* client,
51 scoped_ptr<WebInbandTextTrackImpl> text_track);
53 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
54 blink::WebMediaPlayerClient* client_;
55 scoped_ptr<WebInbandTextTrackImpl> text_track_;
56 DISALLOW_COPY_AND_ASSIGN(TextTrackImpl);
59 } // namespace media
61 #endif // MEDIA_BLINK_TEXTTRACK_IMPL_H_