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

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

Issue 360323002: MediaSource must use ref-counting to handle pending activity counting. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 namespace blink { 45 namespace blink {
46 class WebSourceBuffer; 46 class WebSourceBuffer;
47 } 47 }
48 48
49 namespace WebCore { 49 namespace WebCore {
50 50
51 class ExceptionState; 51 class ExceptionState;
52 class GenericEventQueue; 52 class GenericEventQueue;
53 53
54 // FIXME: Oilpan: Change this to RefCountedGarbageCollectedWillBeGarbageCollecte dFinalized
55 // if MediaSource stops using ActiveDOMObject::setPendingActivity.
54 class MediaSource FINAL 56 class MediaSource FINAL
55 : public RefCountedGarbageCollectedWillBeGarbageCollectedFinalized<MediaSour ce> 57 : public RefCountedGarbageCollected<MediaSource>
56 , public HTMLMediaSource 58 , public HTMLMediaSource
57 , public ActiveDOMObject 59 , public ActiveDOMObject
58 , public EventTargetWithInlineData 60 , public EventTargetWithInlineData
59 , public ScriptWrappable { 61 , public ScriptWrappable {
60 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<M ediaSource>); 62 DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedGarbageCollected<MediaSource>);
61 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaSource); 63 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaSource);
62 public: 64 public:
63 static const AtomicString& openKeyword(); 65 static const AtomicString& openKeyword();
64 static const AtomicString& closedKeyword(); 66 static const AtomicString& closedKeyword();
65 static const AtomicString& endedKeyword(); 67 static const AtomicString& endedKeyword();
66 68
67 static MediaSource* create(ExecutionContext*); 69 static MediaSource* create(ExecutionContext*);
68 virtual ~MediaSource(); 70 virtual ~MediaSource();
69 71
70 // MediaSource.idl methods 72 // MediaSource.idl methods
71 SourceBufferList* sourceBuffers() { return m_sourceBuffers.get(); } 73 SourceBufferList* sourceBuffers() { return m_sourceBuffers.get(); }
72 SourceBufferList* activeSourceBuffers() { return m_activeSourceBuffers.get() ; } 74 SourceBufferList* activeSourceBuffers() { return m_activeSourceBuffers.get() ; }
73 SourceBuffer* addSourceBuffer(const String& type, ExceptionState&); 75 SourceBuffer* addSourceBuffer(const String& type, ExceptionState&);
74 void removeSourceBuffer(SourceBuffer*, ExceptionState&); 76 void removeSourceBuffer(SourceBuffer*, ExceptionState&);
75 void setDuration(double, ExceptionState&); 77 void setDuration(double, ExceptionState&);
76 const AtomicString& readyState() const { return m_readyState; } 78 const AtomicString& readyState() const { return m_readyState; }
77 void endOfStream(const AtomicString& error, ExceptionState&); 79 void endOfStream(const AtomicString& error, ExceptionState&);
78 void endOfStream(ExceptionState&); 80 void endOfStream(ExceptionState&);
79 static bool isTypeSupported(const String& type); 81 static bool isTypeSupported(const String& type);
80 82
81 // HTMLMediaSource 83 // HTMLMediaSource
82 virtual bool attachToElement(HTMLMediaElement*) OVERRIDE; 84 virtual bool attachToElement(HTMLMediaElement*) OVERRIDE;
83 virtual void setWebMediaSourceAndOpen(PassOwnPtr<blink::WebMediaSource>) OVE RRIDE; 85 virtual void setWebMediaSourceAndOpen(PassOwnPtr<blink::WebMediaSource>) OVE RRIDE;
84 virtual void close() OVERRIDE; 86 virtual void close() OVERRIDE;
85 virtual bool isClosed() const OVERRIDE; 87 virtual bool isClosed() const OVERRIDE;
86 virtual double duration() const OVERRIDE; 88 virtual double duration() const OVERRIDE;
87 virtual PassRefPtr<TimeRanges> buffered() const OVERRIDE; 89 virtual PassRefPtr<TimeRanges> buffered() const OVERRIDE;
90 #if !ENABLE(OILPAN)
88 virtual void refHTMLMediaSource() OVERRIDE { ref(); } 91 virtual void refHTMLMediaSource() OVERRIDE { ref(); }
89 virtual void derefHTMLMediaSource() OVERRIDE { deref(); } 92 virtual void derefHTMLMediaSource() OVERRIDE { deref(); }
93 #endif
90 94
91 // EventTarget interface 95 // EventTarget interface
92 virtual const AtomicString& interfaceName() const OVERRIDE; 96 virtual const AtomicString& interfaceName() const OVERRIDE;
93 virtual ExecutionContext* executionContext() const OVERRIDE; 97 virtual ExecutionContext* executionContext() const OVERRIDE;
94 98
95 // ActiveDOMObject interface 99 // ActiveDOMObject interface
96 virtual bool hasPendingActivity() const OVERRIDE; 100 virtual bool hasPendingActivity() const OVERRIDE;
97 virtual void stop() OVERRIDE; 101 virtual void stop() OVERRIDE;
98 102
99 // URLRegistrable interface 103 // URLRegistrable interface
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 // FIXME: oilpan: This should become a Member. For now, m_attachedElement wi ll be cleared by the HTMLMediaElement destructor. 135 // FIXME: oilpan: This should become a Member. For now, m_attachedElement wi ll be cleared by the HTMLMediaElement destructor.
132 HTMLMediaElement* m_attachedElement; 136 HTMLMediaElement* m_attachedElement;
133 137
134 Member<SourceBufferList> m_sourceBuffers; 138 Member<SourceBufferList> m_sourceBuffers;
135 Member<SourceBufferList> m_activeSourceBuffers; 139 Member<SourceBufferList> m_activeSourceBuffers;
136 }; 140 };
137 141
138 } // namespace WebCore 142 } // namespace WebCore
139 143
140 #endif 144 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698