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

Side by Side Diff: Source/modules/mediasource/MediaSourceBase.h

Issue 26878003: Reduce repetitive EventTarget subclassing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix nit Created 7 years, 2 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 27 matching lines...) Expand all
38 #include "core/platform/graphics/MediaSourcePrivate.h" 38 #include "core/platform/graphics/MediaSourcePrivate.h"
39 #include "wtf/PassOwnPtr.h" 39 #include "wtf/PassOwnPtr.h"
40 #include "wtf/RefCounted.h" 40 #include "wtf/RefCounted.h"
41 #include "wtf/Vector.h" 41 #include "wtf/Vector.h"
42 42
43 namespace WebCore { 43 namespace WebCore {
44 44
45 class ExceptionState; 45 class ExceptionState;
46 class GenericEventQueue; 46 class GenericEventQueue;
47 47
48 class MediaSourceBase : public RefCounted<MediaSourceBase>, public HTMLMediaSour ce, public ActiveDOMObject, public EventTarget { 48 class MediaSourceBase : public RefCounted<MediaSourceBase>, public HTMLMediaSour ce, public ActiveDOMObject, public EventTargetWithInlineData {
49 public: 49 public:
50 static const AtomicString& openKeyword(); 50 static const AtomicString& openKeyword();
51 static const AtomicString& closedKeyword(); 51 static const AtomicString& closedKeyword();
52 static const AtomicString& endedKeyword(); 52 static const AtomicString& endedKeyword();
53 53
54 virtual ~MediaSourceBase(); 54 virtual ~MediaSourceBase();
55 55
56 void addedToRegistry(); 56 void addedToRegistry();
57 void removedFromRegistry(); 57 void removedFromRegistry();
58 void openIfInEndedState(); 58 void openIfInEndedState();
(...skipping 14 matching lines...) Expand all
73 void setReadyState(const AtomicString&); 73 void setReadyState(const AtomicString&);
74 void endOfStream(const AtomicString& error, ExceptionState&); 74 void endOfStream(const AtomicString& error, ExceptionState&);
75 75
76 76
77 // ActiveDOMObject interface 77 // ActiveDOMObject interface
78 virtual bool hasPendingActivity() const OVERRIDE; 78 virtual bool hasPendingActivity() const OVERRIDE;
79 virtual void stop() OVERRIDE; 79 virtual void stop() OVERRIDE;
80 80
81 // EventTarget interface 81 // EventTarget interface
82 virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE; 82 virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE;
83 virtual EventTargetData* eventTargetData() OVERRIDE;
84 virtual EventTargetData* ensureEventTargetData() OVERRIDE;
85 virtual void refEventTarget() OVERRIDE { ref(); } 83 virtual void refEventTarget() OVERRIDE { ref(); }
86 virtual void derefEventTarget() OVERRIDE { deref(); } 84 virtual void derefEventTarget() OVERRIDE { deref(); }
87 85
88 // URLRegistrable interface 86 // URLRegistrable interface
89 virtual URLRegistry& registry() const OVERRIDE; 87 virtual URLRegistry& registry() const OVERRIDE;
90 88
91 using RefCounted<MediaSourceBase>::ref; 89 using RefCounted<MediaSourceBase>::ref;
92 using RefCounted<MediaSourceBase>::deref; 90 using RefCounted<MediaSourceBase>::deref;
93 91
94 protected: 92 protected:
95 explicit MediaSourceBase(ScriptExecutionContext*); 93 explicit MediaSourceBase(ScriptExecutionContext*);
96 94
97 virtual void onReadyStateChange(const AtomicString& oldState, const AtomicSt ring& newState) = 0; 95 virtual void onReadyStateChange(const AtomicString& oldState, const AtomicSt ring& newState) = 0;
98 virtual Vector<RefPtr<TimeRanges> > activeRanges() const = 0; 96 virtual Vector<RefPtr<TimeRanges> > activeRanges() const = 0;
99 97
100 PassOwnPtr<SourceBufferPrivate> createSourceBufferPrivate(const String& type , const MediaSourcePrivate::CodecsArray&, ExceptionState&); 98 PassOwnPtr<SourceBufferPrivate> createSourceBufferPrivate(const String& type , const MediaSourcePrivate::CodecsArray&, ExceptionState&);
101 void scheduleEvent(const AtomicString& eventName); 99 void scheduleEvent(const AtomicString& eventName);
102 GenericEventQueue* asyncEventQueue() const { return m_asyncEventQueue.get(); } 100 GenericEventQueue* asyncEventQueue() const { return m_asyncEventQueue.get(); }
103 101
104 private: 102 private:
105 OwnPtr<MediaSourcePrivate> m_private; 103 OwnPtr<MediaSourcePrivate> m_private;
106 EventTargetData m_eventTargetData;
107 AtomicString m_readyState; 104 AtomicString m_readyState;
108 OwnPtr<GenericEventQueue> m_asyncEventQueue; 105 OwnPtr<GenericEventQueue> m_asyncEventQueue;
109 HTMLMediaElement* m_attachedElement; 106 HTMLMediaElement* m_attachedElement;
110 }; 107 };
111 108
112 } 109 }
113 110
114 #endif 111 #endif
OLDNEW
« no previous file with comments | « Source/modules/indexeddb/IDBTransaction.cpp ('k') | Source/modules/mediasource/MediaSourceBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698