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

Side by Side Diff: Source/core/html/track/TrackBase.h

Issue 284513003: Implement AudioTrack, AudioTrackList, VideoTrack, and VideoTrackList (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: platform handle per track Created 6 years, 7 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
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 14 matching lines...) Expand all
25 25
26 #ifndef TrackBase_h 26 #ifndef TrackBase_h
27 #define TrackBase_h 27 #define TrackBase_h
28 28
29 #include "platform/heap/Handle.h" 29 #include "platform/heap/Handle.h"
30 #include "wtf/RefCounted.h" 30 #include "wtf/RefCounted.h"
31 #include "wtf/text/AtomicString.h" 31 #include "wtf/text/AtomicString.h"
32 32
33 namespace WebCore { 33 namespace WebCore {
34 34
35 class HTMLMediaElement;
36
35 class TrackBase : public RefCountedWillBeRefCountedGarbageCollected<TrackBase> { 37 class TrackBase : public RefCountedWillBeRefCountedGarbageCollected<TrackBase> {
36 public: 38 public:
37 virtual ~TrackBase(); 39 virtual ~TrackBase();
38 40
39 enum Type { TextTrack, AudioTrack, VideoTrack }; 41 enum Type { TextTrack, AudioTrack, VideoTrack };
40 Type type() const { return m_type; } 42 Type type() const { return m_type; }
41 43
42 const AtomicString& kind() const { return m_kind; } 44 const AtomicString& kind() const { return m_kind; }
43 virtual void setKind(const AtomicString&); 45 virtual void setKind(const AtomicString&);
44 46
45 AtomicString label() const { return m_label; } 47 AtomicString label() const { return m_label; }
46 void setLabel(const AtomicString& label) { m_label = label; } 48 void setLabel(const AtomicString& label) { m_label = label; }
47 49
48 AtomicString language() const { return m_language; } 50 AtomicString language() const { return m_language; }
49 void setLanguage(const AtomicString& language) { m_language = language; } 51 void setLanguage(const AtomicString& language) { m_language = language; }
50 52
51 AtomicString id() const { return m_id; } 53 String id() const { return m_id; }
52 void setId(const AtomicString& id) { m_id = id; } 54 void setId(const String& id) { m_id = id; }
55
56 void setMediaElement(HTMLMediaElement* mediaElement) { m_mediaElement = medi aElement; }
57 HTMLMediaElement* mediaElement() const { return m_mediaElement; }
53 58
54 virtual void trace(Visitor*) { } 59 virtual void trace(Visitor*) { }
55 60
56 protected: 61 protected:
57 TrackBase(Type, const AtomicString& label, const AtomicString& language, con st AtomicString& id); 62 TrackBase(Type, const AtomicString& label, const AtomicString& language, con st String& id);
58 63
59 virtual bool isValidKind(const AtomicString&) const = 0; 64 virtual bool isValidKind(const AtomicString&) const = 0;
60 virtual AtomicString defaultKind() const = 0; 65 virtual AtomicString defaultKind() const = 0;
61 66
62 private: 67 private:
63 Type m_type; 68 Type m_type;
64 AtomicString m_kind; 69 AtomicString m_kind;
65 AtomicString m_label; 70 AtomicString m_label;
66 AtomicString m_language; 71 AtomicString m_language;
67 AtomicString m_id; 72 String m_id;
73 HTMLMediaElement* m_mediaElement;
68 }; 74 };
69 75
70 } // namespace WebCore 76 } // namespace WebCore
71 77
72 #endif // TrackBase_h 78 #endif // TrackBase_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698