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 15 matching lines...) Expand all Loading... |
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 ScriptExecutionContext; | 34 class ScriptExecutionContext; |
35 | 35 |
36 class TrackBase : public RefCounted<TrackBase>, public EventTarget { | 36 class TrackBase : public RefCounted<TrackBase>, public EventTargetWithInlineData
{ |
37 public: | 37 public: |
38 virtual ~TrackBase(); | 38 virtual ~TrackBase(); |
39 | 39 |
40 enum Type { BaseTrack, TextTrack, AudioTrack, VideoTrack }; | 40 enum Type { BaseTrack, TextTrack, AudioTrack, VideoTrack }; |
41 Type type() const { return m_type; } | 41 Type type() const { return m_type; } |
42 | 42 |
43 virtual const AtomicString& interfaceName() const; | 43 virtual const AtomicString& interfaceName() const OVERRIDE; |
44 virtual ScriptExecutionContext* scriptExecutionContext() const; | 44 virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE; |
45 | 45 |
46 using RefCounted<TrackBase>::ref; | 46 using RefCounted<TrackBase>::ref; |
47 using RefCounted<TrackBase>::deref; | 47 using RefCounted<TrackBase>::deref; |
48 | 48 |
49 protected: | 49 protected: |
50 TrackBase(ScriptExecutionContext*, Type); | 50 TrackBase(ScriptExecutionContext*, Type); |
51 | 51 |
52 virtual EventTargetData* eventTargetData(); | |
53 virtual EventTargetData* ensureEventTargetData(); | |
54 | |
55 private: | 52 private: |
56 Type m_type; | 53 Type m_type; |
57 | 54 |
58 virtual void refEventTarget() { ref(); } | 55 virtual void refEventTarget() OVERRIDE { ref(); } |
59 virtual void derefEventTarget() { deref(); } | 56 virtual void derefEventTarget() OVERRIDE { deref(); } |
60 | 57 |
61 ScriptExecutionContext* m_scriptExecutionContext; | 58 ScriptExecutionContext* m_scriptExecutionContext; |
62 EventTargetData m_eventTargetData; | |
63 }; | 59 }; |
64 | 60 |
65 } // namespace WebCore | 61 } // namespace WebCore |
66 | 62 |
67 #endif // TrackBase_h | 63 #endif // TrackBase_h |
OLD | NEW |