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

Side by Side Diff: content/renderer/media/webrtc_audio_renderer.h

Issue 2758453004: Remove dangling PlayingState pointers in WebRtcAudioRenderer. (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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_
6 #define CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_ 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
11 #include <memory>
11 #include <string> 12 #include <string>
12 #include <vector> 13 #include <vector>
13 14
14 #include "base/macros.h" 15 #include "base/macros.h"
15 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
16 #include "base/single_thread_task_runner.h" 17 #include "base/single_thread_task_runner.h"
17 #include "base/synchronization/lock.h" 18 #include "base/synchronization/lock.h"
18 #include "base/threading/non_thread_safe.h" 19 #include "base/threading/non_thread_safe.h"
19 #include "base/threading/thread_checker.h" 20 #include "base/threading/thread_checker.h"
20 #include "content/public/renderer/media_stream_audio_renderer.h" 21 #include "content/public/renderer/media_stream_audio_renderer.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 // it had already been removed or if the source isn't being rendered. 185 // it had already been removed or if the source isn't being rendered.
185 bool RemovePlayingState(webrtc::AudioSourceInterface* source, 186 bool RemovePlayingState(webrtc::AudioSourceInterface* source,
186 PlayingState* state); 187 PlayingState* state);
187 188
188 // Called whenever the Play/Pause state changes of any of the renderers 189 // Called whenever the Play/Pause state changes of any of the renderers
189 // or if the volume of any of them is changed. 190 // or if the volume of any of them is changed.
190 // Here we update the shared Play state and apply volume scaling to all audio 191 // Here we update the shared Play state and apply volume scaling to all audio
191 // sources associated with the |media_stream| based on the collective volume 192 // sources associated with the |media_stream| based on the collective volume
192 // of playing renderers. 193 // of playing renderers.
193 void OnPlayStateChanged(const blink::WebMediaStream& media_stream, 194 void OnPlayStateChanged(const blink::WebMediaStream& media_stream,
194 PlayingState* state); 195 PlayingState* state,
196 bool playing_state_deleted);
tommi (sloooow) - chröme 2017/03/17 12:44:08 what about including a TODO here to clean this up.
Max Morin 2017/03/17 14:08:03 I put a TODO in OnPlayStateRemoved.
195 197
196 // Updates |sink_params_| and |audio_fifo_| based on |sink_|, and initializes 198 // Updates |sink_params_| and |audio_fifo_| based on |sink_|, and initializes
197 // |sink_|. 199 // |sink_|.
198 void PrepareSink(); 200 void PrepareSink();
199 201
200 // The RenderFrame in which the audio is rendered into |sink_|. 202 // The RenderFrame in which the audio is rendered into |sink_|.
201 const int source_render_frame_id_; 203 const int source_render_frame_id_;
202 const int session_id_; 204 const int session_id_;
203 205
204 const scoped_refptr<base::SingleThreadTaskRunner> signaling_thread_; 206 const scoped_refptr<base::SingleThreadTaskRunner> signaling_thread_;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 // Stores the maximum time spent waiting for render data from the source. Used 256 // Stores the maximum time spent waiting for render data from the source. Used
255 // for logging UMA data. Logged and reset when Stop() is called. 257 // for logging UMA data. Logged and reset when Stop() is called.
256 base::TimeDelta max_render_time_; 258 base::TimeDelta max_render_time_;
257 259
258 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcAudioRenderer); 260 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcAudioRenderer);
259 }; 261 };
260 262
261 } // namespace content 263 } // namespace content
262 264
263 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_ 265 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/webrtc_audio_renderer.cc » ('j') | content/renderer/media/webrtc_audio_renderer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698