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

Side by Side Diff: third_party/WebKit/Source/platform/mediastream/MediaStreamSource.h

Issue 2757883002: Revert "Pull AudioDestinationConsumer off the Blink GC heap." (Closed)
Patch Set: Created 3 years, 9 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) 2011 Ericsson AB. All rights reserved. 2 * Copyright (C) 2011 Ericsson AB. All rights reserved.
3 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 } 95 }
96 WebMediaConstraints constraints() { return m_constraints; } 96 WebMediaConstraints constraints() { return m_constraints; }
97 void getSettings(WebMediaStreamTrack::Settings&); 97 void getSettings(WebMediaStreamTrack::Settings&);
98 98
99 void setAudioFormat(size_t numberOfChannels, float sampleRate); 99 void setAudioFormat(size_t numberOfChannels, float sampleRate);
100 void consumeAudio(AudioBus*, size_t numberOfFrames); 100 void consumeAudio(AudioBus*, size_t numberOfFrames);
101 101
102 bool requiresAudioConsumer() const { return m_requiresConsumer; } 102 bool requiresAudioConsumer() const { return m_requiresConsumer; }
103 void addAudioConsumer(AudioDestinationConsumer*); 103 void addAudioConsumer(AudioDestinationConsumer*);
104 bool removeAudioConsumer(AudioDestinationConsumer*); 104 bool removeAudioConsumer(AudioDestinationConsumer*);
105 const HashSet<AudioDestinationConsumer*>& audioConsumers() { 105 const HeapHashSet<Member<AudioDestinationConsumer>>& audioConsumers() {
106 return m_audioConsumers; 106 return m_audioConsumers;
107 } 107 }
108 108
109 // |m_extraData| may hold pointers to GC objects, and it may touch them in 109 // |m_extraData| may hold pointers to GC objects, and it may touch them in
110 // destruction. So this class is eagerly finalized to finalize |m_extraData| 110 // destruction. So this class is eagerly finalized to finalize |m_extraData|
111 // promptly. 111 // promptly.
112 EAGERLY_FINALIZE(); 112 EAGERLY_FINALIZE();
113 DECLARE_TRACE(); 113 DECLARE_TRACE();
114 114
115 private: 115 private:
116 MediaStreamSource(const String& id, 116 MediaStreamSource(const String& id,
117 StreamType, 117 StreamType,
118 const String& name, 118 const String& name,
119 ReadyState, 119 ReadyState,
120 bool requiresConsumer); 120 bool requiresConsumer);
121 121
122 String m_id; 122 String m_id;
123 StreamType m_type; 123 StreamType m_type;
124 String m_name; 124 String m_name;
125 ReadyState m_readyState; 125 ReadyState m_readyState;
126 bool m_requiresConsumer; 126 bool m_requiresConsumer;
127 HeapHashSet<WeakMember<Observer>> m_observers; 127 HeapHashSet<WeakMember<Observer>> m_observers;
128 Mutex m_audioConsumersLock; 128 Mutex m_audioConsumersLock;
129 HashSet<AudioDestinationConsumer*> m_audioConsumers; 129 HeapHashSet<Member<AudioDestinationConsumer>> m_audioConsumers;
130 std::unique_ptr<ExtraData> m_extraData; 130 std::unique_ptr<ExtraData> m_extraData;
131 WebMediaConstraints m_constraints; 131 WebMediaConstraints m_constraints;
132 }; 132 };
133 133
134 typedef HeapVector<Member<MediaStreamSource>> MediaStreamSourceVector; 134 typedef HeapVector<Member<MediaStreamSource>> MediaStreamSourceVector;
135 135
136 } // namespace blink 136 } // namespace blink
137 137
138 #endif // MediaStreamSource_h 138 #endif // MediaStreamSource_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698