| 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 "wtf/RefCounted.h" | 29 #include "wtf/RefCounted.h" |
| 30 #include "wtf/text/AtomicString.h" | 30 #include "wtf/text/AtomicString.h" |
| 31 | 31 |
| 32 namespace WebCore { | 32 namespace WebCore { |
| 33 | 33 |
| 34 class HTMLMediaElement; |
| 35 |
| 34 class TrackBase : public RefCounted<TrackBase> { | 36 class TrackBase : public RefCounted<TrackBase> { |
| 35 public: | 37 public: |
| 36 virtual ~TrackBase(); | 38 virtual ~TrackBase(); |
| 37 | 39 |
| 38 enum Type { TextTrack, AudioTrack, VideoTrack }; | 40 enum Type { TextTrack, AudioTrack, VideoTrack }; |
| 39 Type type() const { return m_type; } | 41 Type type() const { return m_type; } |
| 40 | 42 |
| 41 const AtomicString& kind() const { return m_kind; } | 43 const AtomicString& kind() const { return m_kind; } |
| 42 virtual void setKind(const AtomicString&); | 44 virtual void setKind(const AtomicString&); |
| 43 | 45 |
| 44 AtomicString label() const { return m_label; } | 46 AtomicString label() const { return m_label; } |
| 45 void setLabel(const AtomicString& label) { m_label = label; } | 47 void setLabel(const AtomicString& label) { m_label = label; } |
| 46 | 48 |
| 47 AtomicString language() const { return m_language; } | 49 AtomicString language() const { return m_language; } |
| 48 void setLanguage(const AtomicString& language) { m_language = language; } | 50 void setLanguage(const AtomicString& language) { m_language = language; } |
| 49 | 51 |
| 50 AtomicString id() const { return m_id; } | 52 String id() const { return m_id; } |
| 51 void setId(const AtomicString& id) { m_id = id; } | 53 void setId(const String& id) { m_id = id; } |
| 54 |
| 55 void setMediaElement(HTMLMediaElement* mediaElement) { m_mediaElement = medi
aElement; } |
| 56 HTMLMediaElement* mediaElement() const { return m_mediaElement; } |
| 52 | 57 |
| 53 protected: | 58 protected: |
| 54 TrackBase(Type, const AtomicString& label, const AtomicString& language, con
st AtomicString& id); | 59 TrackBase(Type, const AtomicString& label, const AtomicString& language, con
st String& id); |
| 55 | 60 |
| 56 virtual bool isValidKind(const AtomicString&) const = 0; | 61 virtual bool isValidKind(const AtomicString&) const = 0; |
| 57 virtual AtomicString defaultKind() const = 0; | 62 virtual AtomicString defaultKind() const = 0; |
| 58 | 63 |
| 59 private: | 64 private: |
| 60 Type m_type; | 65 Type m_type; |
| 61 AtomicString m_kind; | 66 AtomicString m_kind; |
| 62 AtomicString m_label; | 67 AtomicString m_label; |
| 63 AtomicString m_language; | 68 AtomicString m_language; |
| 64 AtomicString m_id; | 69 String m_id; |
| 70 HTMLMediaElement* m_mediaElement; |
| 65 }; | 71 }; |
| 66 | 72 |
| 67 } // namespace WebCore | 73 } // namespace WebCore |
| 68 | 74 |
| 69 #endif // TrackBase_h | 75 #endif // TrackBase_h |
| OLD | NEW |