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 13 matching lines...) Expand all Loading... | |
24 */ | 24 */ |
25 | 25 |
26 #ifndef TrackBase_h | 26 #ifndef TrackBase_h |
27 #define TrackBase_h | 27 #define TrackBase_h |
28 | 28 |
29 #include "core/events/EventTarget.h" | 29 #include "core/events/EventTarget.h" |
30 #include "wtf/RefCounted.h" | 30 #include "wtf/RefCounted.h" |
31 | 31 |
32 namespace WebCore { | 32 namespace WebCore { |
33 | 33 |
34 class TrackBase : public RefCounted<TrackBase>, public EventTargetWithInlineData { | 34 class HTMLMediaElement; |
35 REFCOUNTED_EVENT_TARGET(TrackBase); | 35 |
36 class TrackBase : public RefCounted<TrackBase> { | |
36 public: | 37 public: |
37 virtual ~TrackBase() { } | 38 virtual ~TrackBase(); |
38 | 39 |
39 enum Type { TextTrack, AudioTrack, VideoTrack }; | 40 enum Type { TextTrack, AudioTrack, VideoTrack }; |
40 Type type() const { return m_type; } | 41 Type type() const { return m_type; } |
41 | 42 |
43 void setMediaElement(HTMLMediaElement* element) { m_mediaElement = element; } | |
acolwell GONE FROM CHROMIUM
2013/11/28 03:02:17
Does the base really need a reference to the media
| |
44 HTMLMediaElement* mediaElement() { return m_mediaElement; } | |
45 | |
46 AtomicString kind() const { return m_kind; } | |
47 virtual void setKind(const AtomicString&); | |
48 | |
49 AtomicString label() const { return m_label; } | |
50 void setLabel(const AtomicString& label) { m_label = label; } | |
51 | |
52 AtomicString language() const { return m_language; } | |
53 void setLanguage(const AtomicString& language) { m_language = language; } | |
54 | |
55 AtomicString id() const { return m_id; } | |
56 void setId(const AtomicString& id) { m_id = id; } | |
57 | |
42 protected: | 58 protected: |
43 explicit TrackBase(Type type) : m_type(type) { } | 59 explicit TrackBase(Type, const AtomicString& label, const AtomicString& lang uage, const AtomicString& id); |
acolwell GONE FROM CHROMIUM
2013/11/28 03:02:17
nit: remove explicit
| |
60 | |
61 virtual bool isValidKind(const AtomicString&) const = 0; | |
62 virtual AtomicString defaultKind() const = 0; | |
44 | 63 |
45 private: | 64 private: |
46 Type m_type; | 65 Type m_type; |
66 HTMLMediaElement* m_mediaElement; | |
67 AtomicString m_kind; | |
68 AtomicString m_label; | |
69 AtomicString m_language; | |
70 AtomicString m_id; | |
47 }; | 71 }; |
48 | 72 |
49 } // namespace WebCore | 73 } // namespace WebCore |
50 | 74 |
51 #endif // TrackBase_h | 75 #endif // TrackBase_h |
OLD | NEW |